Sign in Join

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

Mailing lists / lazarus / 2009-11

Bitmap assign does not copy PixelFormat...

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Unknown author

I think I posted about this about 4 or 5 months ago and I think someone applied a patch, but it seems this bug is back.

When 1 bitmap which is say 24bit, is assigned to another bitmap which is say 32bit, the second bitmap seems to preserve its 32bitness, when it should not, because an assign has taken place.

The following example illustrates the issue...

var
  thebitmap : TBitmap;
  undoimg : TBitmap;
begin
  thebitmap := TBitmap.Create;
  thebitmap.PixelFormat := pf24bit; // definitely 24bit
  undoimg := TBitmap.Create; // default bit depth
  undoimg.Assign(thebitmap);
  //undoimg is now not 24bit! it is whatever the default is when a new
Bitmap is constructed.
end;

I can submit this as another bug report, if necessary.

This was tested in Mac OS X 10.5.8, using Lazarus revision 22631.

Thanks,

Dominique.

Reply by email