[lazarus] Bitmap transparency?

Micha Nelissen M.Nelissen at student.tue.nl
Mon Nov 10 01:58:35 EST 2003


Mattias Gaertner wrote:

> On Sun, 09 Nov 2003 17:16:13 +0100
> Micha Nelissen <M.Nelissen at student.tue.nl> wrote:
> 
> 
>>Mattias Gaertner wrote:
>>
>>
>>>On Sun, 09 Nov 2003 15:08:06 +0100
>>>Micha Nelissen <M.Nelissen at student.tue.nl> wrote:
>>>
>>>
>>>
>>>>Mattias Gaertner wrote:
>>>>
>>>>
>>>>
>>>>>On Sat, 08 Nov 2003 18:15:13 +0100
>>>>>Marc Weustink <marc at dommelstein.net> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>>Yes, but the LCL depends on this 'native' pixmap support for
>>>>>>>transparency.
>>>>>
>>>>>
>>>>>Only in a few cases. And they can be changed easily. In fact, they are
>>>>>leftovers from days whithout choice.
>>>>>
>>>>>Some general notes:
>>>>>Eventually we will switch to fpImage. This means the LCL won't need
>>>>>CreatePixmapIndirect anymore. fpImage requires, that the win32 intf
>>>>>supports the 5 RawImage functions.
>>>>>Micha, can you implement them?
>>>>
>>>>I have been looking, but I can't find it in the archives / code: what 
>>>>functions do I need to implement?
>>>
>>>
>>BTW: HBITMAP's don't know anything about their palette in win32. I know 
>>palettes are not supported yet, but how should I work with it? Ie. I 
>>must fill the ImageDescription with something.
> 
> 
> Hmm. What kind of information is available for a bitmap under win32?

Winapi function GetObject returns a BITMAP info structure containing:

bmType

Specifies the bitmap type. This member must be zero.

bmWidth

Specifies the width, in pixels, of the bitmap. The width must be greater 
than zero.

bmHeight

Specifies the height, in pixels, of the bitmap. The height must be 
greater than zero.

bmWidthBytes

Specifies the number of bytes in each scan line. This value must be 
divisible by 2, because Windows assumes that the bit values of a bitmap 
form an array that is word aligned.

bmPlanes

Specifies the count of color planes.

bmBitsPixel

Specifies the number of bits required to indicate the color of a pixel.

bmBits

Points to the location of the bit values for the bitmap. The bmBits 
member must be a long pointer to an array of character (1-byte) values.

----

I think I can fill the RawImageDesc fields except palette, and I don't 
know what to do with RedPrec, RedShift, etc..

Micha.







More information about the Lazarus mailing list