Recent

Author Topic: TLTCP components problem  (Read 19178 times)

zdenal027

  • Newbie
  • Posts: 6
Re: TLTCP components problem
« Reply #15 on: April 22, 2011, 10:36:35 am »
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: [Select]
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;
  ...

VideoFrame je typu TImage.

zdenal027

  • Newbie
  • Posts: 6
Re: TLTCP components problem
« Reply #16 on: April 22, 2011, 10:41:34 am »
Maybe the 2 components cannot run in the same (main) thread.
It might help if you put one (or both) in a separate thread.

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...


 

TinyPortal © 2005-2018