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
Delphi & Maskcolor/Usetransparency
Moderators: XnTriq, helmut, xnview
-
- Author of XnView
- Posts: 44920
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Re: Delphi & Maskcolor/Usetransparency
You must change the GFL_BITMAP::TransparentIndexmkeeley 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
Pierre.
-
- Posts: 9
- Joined: Sun Jan 29, 2006 7:09 pm
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
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
-
- Author of XnView
- Posts: 44920
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Ok, right there is no Mask function like GflAX, do you want such function in GFL?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?
Pierre.