Sign in Join

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

Mailing lists / lazarus / 2008-03

Bitmap.Assign loses PixelFormat information on Mac OS X

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Dominique Louis

Hi all,
If I assign a 24bit Bitmap to a newly created bitmap, the PixelFormat info is not copied across.

I am doing the following...

bbb := TBitmap.Create;
bbb.Assign(My24bitBitmap);

bbb is no longer 24bit. It now appears to be pfDevice.

Does this happen on other operating systems?

Dominique.

Reply by email

Marc Weustink
to Dominique Louis
Dominique Louis wrote 10 lines
Hi all, If I assign a 24bit Bitmap to a newly created bitmap, the PixelFormat info is not copied across. I am doing the following... bbb := TBitmap.Create; bbb.Assign(My24bitBitmap); bbb is no longer 24bit. It now appears to be pfDevice.

At this moment all bitmaps are pfDevide per def. Other formats aren't really supported.

Marc

Reply by email

Dominique Louis
to Marc Weustink

Hi Marc,
I totally understand that when you first create a Bitmap it should not have a PixelFormat, so defaulting to pfDevice is fine, but surely in the case of an Assign call it should copy the properties over as well. I would be surprised if it does not work that way in Delphi.

Dominique.

Marc Weustink wrote 16 lines
Dominique Louis wrote: > Hi all, > If I assign a 24bit Bitmap to a newly created bitmap, the PixelFormat > info is not copied across. > > I am doing the following... > > bbb := TBitmap.Create; > bbb.Assign(My24bitBitmap); > > bbb is no longer 24bit. It now appears to be pfDevice. At this moment all bitmaps are pfDevide per def. Other formats aren't really supported. Marc

Reply by email

Marc Weustink
to Dominique Louis
Dominique Louis wrote 5 lines
Hi Marc, I totally understand that when you first create a Bitmap it should not have a PixelFormat, so defaulting to pfDevice is fine, but surely in the case of an Assign call it should copy the properties over as well. I would be surprised if it does not work that way in Delphi.

Maybe I wasn't clear enough, for now, only fpDevice is supported. Whatever format you choose for a TBitmap, it gets always converted to pfDevice the moment you need a handle (and for a bitmap that is sooner than you expect) This is a limitation of the current implementation. It might/will get changed somewhere itn the future, but till then you have only pfDevice.

Marc

Reply by email