Jump to content
Sign in to follow this  
jennico

gif transparency problem - no transparency on win xp style

Recommended Posts

jennico

hi there !

nearly at the point of crying. i made two gifs with a perfect transparency. but when you change the display settings from Classic Windows Style to Win XP Style, the one loses its transparency, while the other one does not.

i cannot explain myself this problem. the two gifs are nearly identical. please help me someone. what do i do wrong with the bigger gif ? i want it to stay transparent, just like the smaller one.

PLEASE HELP !

here is my example and please also download the zipped gifs.

guicreate("My Transparency Enigma")

GUISetBkColor(0xff0000)

GUICtrlCreateLabel("",30,30,100,100)
GUICtrlSetBkColor(-1,0xfff000)

GUICtrlCreatePic("big die.gif",10,10,64,64)

GUICtrlCreatePic("small die.gif",114,15,32,32)

GUISetState()

MsgBox(0,"My Transparency Enigma","Please Switch your display settings between"&@LF& _
        "Windows Classic Style and XP Style."&@LF&@LF& _
        "In XP Style the bigger die loses its transparency."&@LF&@LF& _
        "But why ?"&@LF&@LF&"In both dice the same transparency color "&@LF& _
        "is set to '204,204,204' (0xCCCCCC) "&@LF& _
        "for the round edges and the eyes."&@LF&@LF& _
        "The left upper Pixel is '204,204,204', too."&@LF&@LF& _
        "Please help me !")

Do
    $msg=GUIGetMsg()
Until $msg=-3

thank you all

j.

Edited by jennico

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
jennico

bump !

i wonder why, even

DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)

doesn't help !

PLEASE HELP !


Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
jennico

bump !

personally i don't use the xp themes but somehow there must be a help for the poor people who cannot live without blue borders around their windows.

please help me to fix this annoyance.

j.


Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
smashly

Hi

The color palette for the images are different.

Small image has 4 unique colors, the Big has 15 unique colors.

I gather you resized the smaller image and more unique colors of gray have been added by dithering or resize filters (just a guess).

I tried a fast and dirty resize of the small to large and chose the outer gray edge as the transparent color and it works ok for me with XP Default style.

Cheers

Share this post


Link to post
Share on other sites
jennico

yes, i noticed before that the transparency stays when you just change the size like that:

GUICtrlCreatePic("small die.gif",10,10,64,64)

i will try to reduce the colors of the big one, maybe it helps. but anyway they are only 256 colors bitmaps. i would like to understand the basic problem on that, but i don't find anything.

thank you smashly :)

j.


Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
jennico

okay, i reduced the colors to 4 and it works. !!!!! :)

the 15 colors were added when i used anti-aliasing for the round edges. Very weird issue.

now i will try to add more colors until it loses transparency again. have to find a compromise between quality and transparency.

thx again

j.

Edited by jennico

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
qwert

have to find a compromise between quality and transparency.

Just want to mention that you can use a 24-bit BMP instead of a GIF. I had problems trying to convert your bigdie.gif into something with transparency. MSPaint wouldn't produce a usable BMP from it, but a BMP I created from scratch worked on the first try.

Share this post


Link to post
Share on other sites
jennico

hi qwert

thank you i thought about that, too. i made a set of bmp and experimented a lot with them. as far as i understand, a bmp requires a gui without background ($WS_EX_LAYERED style) in order to appear transparent, while a transparent gif works on any background color and label. so, if i want to use the picture in something like a tab control, a .gif is more convenient.

j.


Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
jennico

after working one night on pixels and palettes i ended up with a very satisfying result. i needed the help of a palette program (colorcache4, very good shareware !).

i found out that it is rather the kind of palette u use than the amount of colors. still i cannot say what is the basic problem, sometimes a 20 color palette worked, sometimes 4 colors did not, depending on the colors. it is an annoying work of trying out, it seems.

my final result has a good quality and consists of 7 gray scale colors out of a 256 color palette and of course transparency in all xp themes. thank you so much smashly for bringing me on the right way. this was hard work !

j.

Edited by jennico

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×