AutoHotkey Community

It is currently May 26th, 2012, 2:22 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: [function]Fade
PostPosted: January 7th, 2008, 9:36 pm 
Offline

Joined: June 4th, 2006, 2:04 pm
Posts: 176
Location: ::1
Just a fade function :roll:
Please note that this script have no effect on Win98/95 or NT4

The function :shock:

Code:
/*
Fade function by ChalamiuS with help from tic
Use:
Fade(WindowName,StartAlpha,EndAlpha,Sleep)
*/
Fade(Window, FromAlpha=255, ToAlpha=0, Sleep=5)
{
   Loop, % (FromAlpha > ToAlpha) ? (FromAlpha-ToAlpha)//5   : (ToAlpha-FromAlpha)//5 ;%
   {
      FromAlpha := (FromAlpha > ToAlpha) ? FromAlpha-5 : FromAlpha+5
      WinSet, Transparent, %FromAlpha%, %Window%
      Sleep %Sleep%
   }
}


Last edited by ChalamiuS on November 4th, 2008, 2:56 pm, edited 8 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 8th, 2008, 3:54 am 
Offline

Joined: October 28th, 2006, 2:14 am
Posts: 297
Location: US
Nifty, I'd hate to rain on your parade but... I think you can use the AnimateWindow dll to do those things, but maybe you can't use that dll on other windows...

_________________
Changed siggy at request of ahklerner :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 8th, 2008, 10:06 am 
Offline

Joined: June 4th, 2006, 2:04 pm
Posts: 176
Location: ::1
Does that one have a setable Sleeptime ? :o
Edit:
DOH it did :( but I still like my own better :lol:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 8th, 2008, 11:44 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
There is very important difference between AnimateWindow and this.
AnimateWindow will stop the script while animation is active, while sleep in the loop of the above function will let the script interupt animation.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 8th, 2008, 7:45 pm 
Offline

Joined: October 16th, 2007, 2:50 am
Posts: 10
Location: Las Vegas, NV, USA
That's neat! Thanks!


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Stigg and 12 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