Sign in to follow this  
Followers 0
yawoo

GUICtrlCreatePic with transparent GIF

10 posts in this topic

I would like to create a transparent image inside a GUI, but the result is not transparent and with white background color instead. Attached the result GUI and the source transparent GIF.

Share this post


Link to post
Share on other sites



did you did the help recommendation

To have a transparent picture it is needed to use a .gif image with the transparency color set and to create the window with WS_EX_LAYERED extended style.

It is always a good idea you post a simplified script that reproduce your problem B)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

did you did the help recommendation

It is always a good idea you post a simplified script that reproduce your problem B)

Sorry, no coding posted, since my coding is too complex and long to post here.

If attribute $WS_EX_LAYERED is applied to GUICreate(), it will cause the whole windows transparent to

the windows OS, rather than the image transparent to the windows created by Autoit.

But if I use GUICtrlCreateIcon, it can make the icon picture transparent to the windows created by Autoit.

Edited by yawoo

Share this post


Link to post
Share on other sites

You cannot use a GUICtrlCreateIcon to load a .gif you need to converted it to an .ico format. B)

Share this post


Link to post
Share on other sites

You cannot use a GUICtrlCreateIcon to load a .gif you need to converted it to an .ico format. B)

Thanks for your information.

The problem I got is that I can use GUICtrlCreateIcon to load transparent .ico file, while using

GUICtrlCreatePic to load transparent .gif file, it cannot show the transparent effect properly.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Thanks for your information.

The problem I got is that I can use GUICtrlCreateIcon to load transparent .ico file, while using

GUICtrlCreatePic to load transparent .gif file, it cannot show the transparent effect properly.

True you have to use .ico format if you want transparency with a control on a specific GUI.

Edit:If somebody have good idea how to extend the transparency on pic control, I will be glad to work on it. B)

Edited by jpm

Share this post


Link to post
Share on other sites

@Larry

I cannot have your example working no transparency B)

Share this post


Link to post
Share on other sites

Windows 2000 may not (natively) support transparent GIF images.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

hmmm you are right. it works (for me) on Win XP without $WS_EX_TRANSPARENT. on windows 2000... no luck yet.

Lar.

in fact this is all I need to work on XP...

#include <GUIConstants.au3>

$gui = GUICreate("Blanky")
GUISetBkColor(0)
$smurf = GUICtrlCreatePic(".\smurf.gif",0,0,113,153)

GUISetState()
Sleep(3000)

GUIDelete($gui)

$gui = GUICreate("Blanky")
GUISetBkColor(0xFFFFFF)
$smurf = GUICtrlCreatePic(".\smurf.gif",0,0,113,153)

GUISetState()
Sleep(3000)
Unless i didn't catch the right .gif It does work for me under XP/Sp2 with classic theme B)

Edit I confirm it is working with XP Theme!!! Can somebody tell what can be the difference? :o

Edited by jpm

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

try something that seems to worked using bmp

1. save the image under PNG

2. open the image using mspaint and save it as 24 bit bmp

3. try loading in place of the gif

works for me

p/s :

- ignore the funky color spits out by mspaint

- picked the tip up from a vb help site

- it might not be gif but .... B)

- i don't think gif transparent is design to work on app form

maybe later version of autoit could include library such as

http://www.soft-gems.net/Graphics.php

Edited by DiskAI

i think

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  
Followers 0