CVS changes and Re: [lazarus] TBitmap transparency
SMiller1 at stvgb.org
Wed Mar 22 14:48:14 EST 2000
Using the mask property within our CreatePixmapIndirect and storing that mask in the PGDIObject I am able to get the trasparent pixmaps to appear correctly on the TBITBTN. On TBITBTN I am packing a gtkHBox or a gtkVBox so I do a gtk_pixmap_new(pixmap,mask) and pack the result.
With Speedbuttons, we aren't doing that. All we do with Speedbutton's is create the gdk_pixmap and do a gdk_pixmap_draw. This function doesn't care about transparency and instead uses the color passed to it and replaces all the "None" colors with that color. That's fine is the base (what the glyph is placeed on) doesn't change colors.
For example, in MAIN.PP I load a few glyph into Pixmap1, Pixmap2, Pixmap3, etc and set the Transpparent color to clBtnFace. If you chage it to clRED you'll notice that all the background color of the image is now red. If you pass it -1 or 0 it places clBack in place of the background.
We need to find some way to get the images on the TSpeedbutton's to appear trasparent. However, at this point the tbitbtn's glyphs ARE transaprent and working fine.
>>> weus at quicknet.nl 03/21/00 06:37PM >>>
At 23:03 21-03-2000 +0100, Marc Weustink wrote:
>At 15:38 21-03-2000 -0600, Shane Miller wrote:
>>looking at the CreatePixmapIndirect the function
>>gdk_pixmap_colormap_create... takes a mask as one of it's parameters. I
>>would say that we put it there.
>Yes, but I think it is of no (or less) use. While loading it replaces all
>the transparent parts with the color given as transparent color (we can
>also use a transparent color in our xpm, like I did in penguin.xpm)
>The result of this is a "solid" pixmap without transparent parts. If you
>draw this, you have still the problem you have now.
>More about this later.
I did some "investigations" and for transparency it should be possible to
BitBlt (same as StrechBlt now),
StretchBlt (stretching part has to be done),
MaskBlt (same as BitBlt but with a mask)
and StrechMaskBlt (not a MS function but logical function here)
For TBitmap I added a maskbitmap and Draw (needs to be implemented).
To unsubscribe: mail lazarus-request at miraclec.com with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus
More information about the Lazarus