Sign in Join

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

Mailing lists / lazarus / 2000-03

TBitmap transparency

8 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Shane Miller

When creating a pixmap you send it the address of a tbtimap where it can put the transparency mask. Currently we send nil but then we can't use transparency.

Can we put this in the PgdiObject as a GDIBitMapMaskObject? That way I think I can use it in the TBitbtn's. Otherwise when the mouse moves over the button and it changes color, you can see the border of the glyph.

Marc, your thoughts?

Shane

Reply by email

Marc Weustink
to Shane Miller: looking at the CreatePixmapIndirect the function gdk_pixmap_colormap_create... takes a…
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.

Marc

Reply by email

Shane Miller

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.

Shane

>> 03/21/00 03:22PM >>>
Shane Miller wrote 9 lines
When creating a pixmap you send it the address of a tbtimap where it can put the transparency mask. Currently we send nil but then we can't use transparency. Can we put this in the PgdiObject as a GDIBitMapMaskObject? That way I think I can use it in the TBitbtn's. Otherwise when the mouse moves over the button and it changes color, you can see the border of the glyph. Marc, your thoughts?

Not sure about GDIBitMapMaskObject. How do you want to select the mask. I don't see it as a part of GDI.
Looking at the functionality it's more like an Icon. CreateIconIndirect for instance requires a bitmap and a mask.
I think this more what you want. I'll look after that tonight

Marc

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Marc Weustink
to Shane Miller: When creating a pixmap you send it the address of a tbtimap where it can put the…
Shane Miller wrote 9 lines
When creating a pixmap you send it the address of a tbtimap where it can put the transparency mask. Currently we send nil but then we can't use transparency. Can we put this in the PgdiObject as a GDIBitMapMaskObject? That way I think I can use it in the TBitbtn's. Otherwise when the mouse moves over the button and it changes color, you can see the border of the glyph. Marc, your thoughts?

Not sure about GDIBitMapMaskObject. How do you want to select the mask. I don't see it as a part of GDI.
Looking at the functionality it's more like an Icon. CreateIconIndirect for instance requires a bitmap and a mask.
I think this more what you want. I'll look after that tonight

Marc

Reply by email

Marc Weustink
to Shane Miller: looking at the CreatePixmapIndirect the function gdk_pixmap_colormap_create... takes a…
Marc Weustink wrote 12 lines
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 implement a
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).

Marc

Reply by email

Peter Dyson
to Shane Miller: Using the mask property within our CreatePixmapIndirect and storing that mask in the…

I just got my linux development box back up after
a memory failure. With some tepidation I got a new full download as it has been well over a week since I was last able to do any work.

Thankfully I was able to cylce the new compiler
and get everything to compile, but the editor now
now segvs on display, by the looks of it on code
that was working the last time I was able to compile.

It seems to be an ansistring problem, looking at the editor code it does seem to be a screwy way they
are using this string that causes the seg fault but it was working before.

A couple of hours trying to get some debug into
the rtl did not throw any light and xxgdb and ddd
did not help much either. (ddd is a slow as an old boot in comparison to xxgdb)

Anyone any ideas on what has changed as far as
ansi strings recently?

Peter

Reply by email

Shane Miller

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.

Shane

>> 03/21/00 06:37PM >>>
Marc Weustink wrote 12 lines
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 implement a
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).

Marc

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Marc Weustink
to Shane Miller
Shane Miller wrote
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.

This is not a part of a GDIobject. wait till the TBitmap.MaskHandle is fully implemented.

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.

See previous comment

Marc

Reply by email