Forum > Networking and Web Programming
TLTCP components problem
zdenal027:
Tak už to funguje. Problém byl ve funkci co dělá vykreslování jpegu. Z pokusných důvodů jsem zakomentoval dva řádky a ejhle... :-)
--- Code: ---procedure TMainForm.DisplayFrame(stream: TStream);
begin
try
stream.Position:=0;
VideoFrame.Picture.Jpeg.LoadFromStream(stream);
except
ListBox2.Items.Add('error while decoding frame!');
exit;
end;
//VideoFrame.Repaint;
//Application.ProcessMessages;
...
--- End code ---
VideoFrame je typu TImage.
zdenal027:
--- Quote from: eny on April 21, 2011, 04:20:06 pm ---Maybe the 2 components cannot run in the same (main) thread.
It might help if you put one (or both) in a separate thread.
--- End quote ---
Hello,
thanks for advice, I was ready to try it, but another solution appears :-) It was caused by function which loads jpeg from stream to TImage. I commented two lines at the end (VideoFrame.Repaint; and Application.ProcessMessages;) and now it works fine. Strange...
Navigation
[0] Message Index
[*] Previous page