[lazarus] Bitmap transparency?

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Nov 9 09:36:41 EST 2003


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?

See winapih.inc, search for RawImage.
See graphtype.pp for the RawImage format. 
intfgraphics.pas contains the TLazIntfImage which uses the 5 functions.

I suggest you start with
GetBitmapRawImageDescription
then
GetRawImageFromBitmap
then
CreateBitmapFromRawImage
then the other two.

The interface does not need to convert the pixels itself. This is done by
TLazIntfImage.

Some notes:
The RawImage format describes uncompressed images in memory. For example:
width, height, bits per pixel, alignment, ... . TLazIntfImage is able to
convert such images. The fpImage color format is a subset of the RawImage
format, hence TLazIntfImage is also able to convert between fpImage formats
and any internal LCL interface format (gtk/X, win32 bmp). 
Because it uses the internal interface format, it is quite fast. For
instance, the XPM reader written in pascal is several times faster than the
gtk c code. 


Mattias






More information about the Lazarus mailing list