Sign in Join

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

Mailing lists / lazarus / 2003-06

TBitmap.Canvas.Pixels bug & questions

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Mattias Gaertner
to Stefan Weber: Setting pixels of a TBitmap via the Canvas does not work, if there's no widget associated…
Show quoted text 8 lines
Setting pixels of a TBitmap via the Canvas does not work, if there's no widget associated with the Canvas. The problem is in LM_SETPixel. Example: bmp := TBitmap.Create; bmp.Width := 16; bmp.Height := 16; bmp.Canvas.Pixels[0,0] := clBlack;

Fixed

Show quoted text 5 lines
Anyway the implementation of SetPixel look quite cumbersome to me, at least for standalone (non gtk) bitmaps. Given a raw bitmap in memory (array of rows of RGB values) what would be the best way to create a TBitmap from it using the LCL?

The SetPixel should work now, but it will be quite slow. The goal is to provide functions to convert such arrays as whole.

It seems that most of the DIB stuff is not yet implemented in LCL (gtk).

Right.

Mattias

Reply by email

Stefan Weber

Setting pixels of a TBitmap via the Canvas does not work, if there's no widget associated with the Canvas. The problem is in LM_SETPixel.

Example:
   bmp := TBitmap.Create;
   bmp.Width := 16;
   bmp.Height := 16;
   bmp.Canvas.Pixels[0,0] := clBlack;

Anyway the implementation of SetPixel look quite cumbersome to me, at least for standalone (non gtk) bitmaps.

Given a raw bitmap in memory (array of rows of RGB values) what would be the best way to create a TBitmap from it using the LCL?

It seems that most of the DIB stuff is not yet implemented in LCL (gtk).

-Stefan

Reply by email