[Lazarus] Fast drawing to canvas

Darius Blaszyk dhkblaszyk at zeelandnet.nl
Wed Feb 8 14:16:35 CET 2012


Well afaik that's exactly what I'm doing with 

Image1.Picture.Bitmap.LoadFromRawImage(bitmaplist[ScrollBar1.Position].RawImage, False);

The flicker went away by placing the code outside the OnPaint handler. I can now draw with about 11fps. The images are streamed continuously from disk! So performance is not really bad, but I would like it to be better.

Regards, Darius





On Feb 8, 2012, at 2:19 AM, Bernd wrote:

> 2012/2/8 Bernd <prof7bit at googlemail.com>:
> 
>> Image.BeginUpdate;
>> Image.Picture.Bitmap.Clear;
>> write the data directly to Image.Picture.Bitmap.RawImage.Data^
>> Image.EndUpdate
> 
> Oh, I forgot: set the size, this is actually the whole point of the
> clear Method: force it to create this raw image of the needed size if
> it does not yet exist.
> 
> Image.BeginUpdate;
> Image.Picture.Bitmap.Width := xxxx;
> Image.Picture.Bitmap.Height := yyyy;
> Image.Picture.Bitmap.Clear;
> write the data directly to Image.Picture.Bitmap.RawImage.Data^
> Image.EndUpdate
> 
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus





More information about the Lazarus mailing list