Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-11

Fastest way to show an image buffer

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Leonardo M. Ramé

Hi, I'm using this routine to show an image buffer in a TImage, but it is not fast enough for my needs.

lBufStream := TMemoryStream.Create;
lBufStream.Write(lBuffer^, lBufSize);
lBufStream.Position := 0;
Image1.Picture.LoadFromStream(lBufStream);
Image1.Invalidate;
lBufStream.Free;

Here http://www.efg2.com/Lab/ImageProcessing/Scanline.htm are many methods, and the one on Listing 15, "Optimized Way to Fill Scanlines from In-Memory Array of Integers" looks very interesting, but it does not work on Lazarus, any alternative?.

Reply by email

Felipe Monteiro de Carvalho
to Leonardo M. Ramé
Leonardo M. Ram? wrote
Hi, I'm using this routine to show an image buffer in a TImage, but it is not fast enough for my needs.

Use a TCustomControl descendent to paint the image and use TLazIntfImage as the image buffer.

TCDGroupBox is a good example which can be seen here: http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/components/customdrawn/customdrawnextras.pas?view=markup&root=lazarus

Also search the wiki for the two classes mentioned.

Felipe Monteiro de Carvalho

Reply by email