AutoHotkey Community

It is currently May 26th, 2012, 3:55 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: April 10th, 2009, 7:17 pm 
Offline

Joined: April 10th, 2009, 6:59 pm
Posts: 8
Location: Michigan, USA
Ok, I've been trying to figure out how to fade a GUI window that has a png image containing transparency. I can get it to fade just fine if I don't make the background of the GUI transparent and just ignore the fact that I'm using a png with transparency. However, if I make the gui transparent and try to fade, two things happen. 1) The window will fade in and out, but the background color will not be transparent, or 2) The window's background will go transparent while leaving a "halo" or "fuzz" around the png image, and the window will not fade in or out.

Here's my code (with a test image):

Code:
Gui, 64: Add, Picture,+BackgroundTrans, axpssp_logo.png
Gui, 64: Color, FFFFFF
Gui, 64: -Caption
Gui, 64: +LastFound
Teleport:=WinExist()
Gui, 64: Show,Hide, Title
WinSet, TransColor, FFFFFF
DllCall("AnimateWindow","UInt",Teleport,"Int",750,"UInt","0xa0000")
Sleep, 600
DllCall("AnimateWindow","UInt",Teleport,"Int",750,"UInt","0x90000")
Gui, 64: Destroy


Here's the test image:
Image


Note: The "axpssp_logo.png" image is just a png file with transparency to show the gyst of my situation. It's not the exact image I will want to display, but it's got the same properties.

Once I get this to work, this will display the on-load info for a pretty involved program (over 185 pages of code so far), so I'm hoping to get it looking good if at all possible...

If anyone can figure this out, I will appreciate it IMMENSELY. I've been beating my head over this issue for days now... Thanks,

1Ender1

_________________
This catacomb has got me by the throat.
--Sers, Depp. Ich will WORSCHT.--
----Tu madre tiene un bigote----


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2009, 7:41 pm 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
First of all, call your -Caption only after you make the window transparent.
Thats according to the AHK help file.

I am still playing with your code - it shows some bizarre behavior when I move the -Caption, but still, maybe thats a hint that may help you figure it out.

_________________
Sector-Seven - Freeware tools built with AutoHotkey


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2009, 8:15 pm 
Offline

Joined: April 10th, 2009, 6:59 pm
Posts: 8
Location: Michigan, USA
Icarus wrote:
First of all, call your -Caption only after you make the window transparent.
Thats according to the AHK help file.


Thanks; I had actually typed this bit of code from memory and must have stuck that in the wrong place; I checked my code, and it was in the right place there. The problem is, when the -Caption is placed after the window is made transparent, it will not fade in. I ran it as I had posted it, and violá, it faded just fine but no transparency...

Quote:
I am still playing with your code - it shows some bizarre behavior when I move the -Caption, but still, maybe thats a hint that may help you figure it out.


Thanks for checking it out- this would help a lot of the effects that I have coded into the program...

_________________
This catacomb has got me by the throat.
--Sers, Depp. Ich will WORSCHT.--
----Tu madre tiene un bigote----


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2009, 8:28 pm 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
Even without your PNG, and even without the DllCalls, I was unable to make both Transparent and TransColor work together. Are you sure they CAN work together?

The DllCall you are using, seem to do the same as if you use Gui, Transparent, so I tested this.

_________________
Sector-Seven - Freeware tools built with AutoHotkey


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2009, 8:36 pm 
Offline

Joined: April 10th, 2009, 6:59 pm
Posts: 8
Location: Michigan, USA
Icarus wrote:
Even without your PNG, and even without the DllCalls, I was unable to make both Transparent and TransColor work together. Are you sure they CAN work together?

The DllCall you are using, seem to do the same as if you use Gui, Transparent, so I tested this.


Thanks Icarus. No, I'm not sure they can work together. I can't think of a way to display the transparency in a png while fading it in or out without this solution, though, as SplashImage doesn't support png images.

Still looking for ideas, if anybody has any. It's not a big chunk of code, but it's pretty tricksome...

_________________
This catacomb has got me by the throat.
--Sers, Depp. Ich will WORSCHT.--
----Tu madre tiene un bigote----


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2009, 9:11 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
I've played around as well :D
This should be quite usable.
Code:
Gui, 64: Add, Picture,+BackgroundTrans, axpssp_logo.png
Gui, 64: Color, FFFFFF
Gui, 64: +LastFound
Teleport:=WinExist()
Gui, 64: -Caption
Gui, 64: Show,Hide, Title
AnimateWindow(teleport,750,"AB")
Gui, 65: Add, Picture,+BackgroundTrans, axpssp_logo.png
Gui, 65: +LastFound
Teleport:=WinExist()
Gui, 65: Color, FFFFFF
WinSet, TransColor, FFFFFF
Gui, 65: -Caption
Gui, 65: Show,, Title
Gui, 64: Destroy
Sleep, 2000
WinSet, TransColor,Off
AnimateWindow(teleport,1,"AB")
AnimateWindow(teleport,750,"HB")
Gui, 65: Destroy


AnimateWindow(hwnd,time,options) {
   Static H:=0x10000, A:=0x20000, C:=0x10, B:=0x80000, S:=0x40000, R:=0x1
   Static L:=0x2, D:=0x4, U:=0x8, O:="HACBSLURD"
   Loop,Parse,options
      If InStr(O,A_LoopField)
         opt+=(%A_LoopField%)
   If opt
      DllCall("AnimateWindow", "UInt", hwnd, "Int", time, "UInt", opt)
}

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2009, 9:34 pm 
Offline

Joined: April 10th, 2009, 6:59 pm
Posts: 8
Location: Michigan, USA
Thanks for working on it HotKey.

However, similar issues are still present. When the code is run with a darker background behind the gui windows, there is a white "fuzz" where the fading to transparency is in the png image... It makes the image look pretty bad when anything darker than white is behind the fading window. Also, after the png fades in, it flickers before showing the whole solid background and fading out again...

_________________
This catacomb has got me by the throat.
--Sers, Depp. Ich will WORSCHT.--
----Tu madre tiene un bigote----


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Exabot [Bot], notsoobvious, Yahoo [Bot] and 23 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group