Page 1 of 1

Delphi & Maskcolor/Usetransparency

Posted: Sun Jan 29, 2006 7:53 pm
by mkeeley
Hello

I'm writing a small utility in Delphi 5 that converts BMP toolbar images I've created in various ways. As you probably know the colour bottom left pixel defines what counts as transparent. I use RGB FF00FF, so all pixels that are that colour apear transparent in the toolbar.

The first test programs I thought I'd try was to convert the BMP to a transparent GIF and then another to convert it to a transparent PNG. However, unlike GflAx, there doesn't seem to be maskcolor or usetransparency (at least they're not defined in libgfl.pas) so I can't make the BMP background color truly transparent before saving.

The closest thing I saw was TransparentIndex, but I assume that's the index in to a colour palette which won't work.

So is there any way to do this? If not could you add it to your to-do list for the next version please.

Thanks

Marc

Re: Delphi & Maskcolor/Usetransparency

Posted: Wed Feb 01, 2006 11:15 am
by xnview
mkeeley wrote:Hello

I'm writing a small utility in Delphi 5 that converts BMP toolbar images I've created in various ways. As you probably know the colour bottom left pixel defines what counts as transparent. I use RGB FF00FF, so all pixels that are that colour apear transparent in the toolbar.

The first test programs I thought I'd try was to convert the BMP to a transparent GIF and then another to convert it to a transparent PNG. However, unlike GflAx, there doesn't seem to be maskcolor or usetransparency (at least they're not defined in libgfl.pas) so I can't make the BMP background color truly transparent before saving.

The closest thing I saw was TransparentIndex, but I assume that's the index in to a colour palette which won't work.

So is there any way to do this? If not could you add it to your to-do list for the next version please.

Thanks

Marc
You must change the GFL_BITMAP::TransparentIndex

Posted: Wed Feb 01, 2006 8:03 pm
by mkeeley
Hello

Don't understand how I'd use TransparentIndex. I assume it's the index in to the colour palette for the transparency colour. However how do I work out what to set it to, my background as usual is #ff00ff.

Also, by default, the BMP's are 24bit but TransparentIndex is only a Int16 (although they're 24 bit not that many colours will be used, not usually more than 500-1000) would that cause a problem?

Thanks

Marc

Posted: Wed Feb 01, 2006 8:44 pm
by xnview
mkeeley wrote:Hello

Don't understand how I'd use TransparentIndex. I assume it's the index in to the colour palette for the transparency colour. However how do I work out what to set it to, my background as usual is #ff00ff.

Also, by default, the BMP's are 24bit but TransparentIndex is only a Int16 (although they're 24 bit not that many colours will be used, not usually more than 500-1000) would that cause a problem?
Ok, right there is no Mask function like GflAX, do you want such function in GFL?

Posted: Wed Feb 01, 2006 8:56 pm
by Guest
It would be really handy. As that way, as you said, you can mask things off and manipulate just the image.

Marc