| View previous topic :: View next topic |
| Author |
Message |
majkinetor
Joined: 24 May 2006 Posts: 3589 Location: Belgrade
|
Posted: Wed Jan 16, 2008 5:19 pm Post subject: Transparent bmp files. |
|
|
There is a way to make transparent bmp files. They say that it needs to be in 256 colors and first pixel to be the one holding the transparent color
I made one such pic in Paint and it didn't show transparentently when loaded into Pic control.
However, when I load the image in GIF Movie Gear and using this tool make it transparent by chosing transparent color, the Pic control loads it transparently....
I checked the image created by GIF Movie Gear and it is indeed in 256 colors (it silently switched, original was in 16b), so there must be something else in this.
Anybody knows something more about this? How AHK Pic control detects transparent bitmaps ? |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5009 Location: imaginationland
|
Posted: Wed Jan 16, 2008 5:38 pm Post subject: |
|
|
Bitmaps don't have alpha channels like PNG/GIF. It's up to the application to use a transparency mask. _________________
RegExReplace("irc.freenode.net/autohotkey", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2") |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3589 Location: Belgrade
|
Posted: Wed Jan 16, 2008 6:01 pm Post subject: |
|
|
Ye I know, but AHK does display transparent bitmap as transparent.
| MSDN wrote: | LR_LOADTRANSPARENT
Retrieves the color value of the first pixel in the image and replaces the corresponding entry in the color table with the default window color (COLOR_WINDOW). All pixels in the image that use that entry become the default window color. This value applies only to images that have corresponding color tables.
Do not use this option if you are loading a bitmap with a color depth greater than 8bpp. |
So, bitmaps DO support transparency, very limited though... |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Mon Jan 21, 2008 12:43 pm Post subject: |
|
|
No, I confirm that bitmaps doesn't support transparency, it is just a convention to take the top-left pixel as transparent color, a constraining one.
Another way is to set one palette entry to transparent.
That's what Gif does, with the additional advantage that this information is coded in the file, unlike BMP where it is up to the programmer to decide if some transparency have to be applied or not, which color to map to transparent, etc.
Neither BMP nor Gif have alpha layer... _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
|