AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Transparent bmp files.

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat
View previous topic :: View next topic  
Author Message
majkinetor



Joined: 24 May 2006
Posts: 3589
Location: Belgrade

PostPosted: Wed Jan 16, 2008 5:19 pm    Post subject: Transparent bmp files. Reply with quote

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
View user's profile Send private message MSN Messenger
Titan



Joined: 11 Aug 2004
Posts: 5009
Location: imaginationland

PostPosted: Wed Jan 16, 2008 5:38 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
majkinetor



Joined: 24 May 2006
Posts: 3589
Location: Belgrade

PostPosted: Wed Jan 16, 2008 6:01 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Mon Jan 21, 2008 12:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group