Jump to content

A few transparency effects UDFs


NELyon
 Share

Recommended Posts

Heres a couple of wrappers i made for Transparency effects. I was just really bored and got ideas from the other transparency-related things lately.

Heres the original topic on my board:

Clicky

UDF:

#Include-Once
;===============================================================================
;
; Description:      Slowly fades in a Window
; Parameter(s):     $hWin - Title of Window
; Requirement(s):   None
; Return Value(s):  On Success - Fades in the winow
;                   On Failure - 0 
;
; Author(s):        Nick Koontz (D-Generation X) (nick AT darkdragonspirit DOT net)
; Note(s): Must be ran on a window that is already transparent or window will dissapear, 
; and fade back in. 
;
;===============================================================================

Func WinFadeIn($hWin)
    $Handle = WinGetHandle($hWin)
    If $Handle = "" Then
        Return 0 
    Else
        
    For $i = 1 to 255 step +3
        $Tr = WinSetTrans($Handle, "", $i)
    Next
    If $Tr = 0 Then
        Return 0
    EndIf
EndIf

EndFunc

;===============================================================================
;
; Description:      Fades Out a window and closes it
; Parameter(s):     $hWin - Title of Window
; Requirement(s):   None
; Return Value(s):  On Success - Fades out the winow and closes it
;                   On Failure - 0 
;
; Author(s):        Nick Koontz (D-Generation X) (nick AT darkdragonspirit DOT net)
; Note(s): This WILL ALSO CLOSE THE window. Beware
;
;===============================================================================

Func WinFadeOut($hWin)
    $Handle = WinGetHandle($hWin)
    If $Handle = "" Then
        Return 0
    Else
        For $i = 255 to 1 step -3
            $Tr = WinSetTrans($Handle, "", $i)
        Next
        WinClose($Handle)
    If $Tr = 0 Then
        Return 0
    EndIf
EndIf
EndFunc

;===============================================================================
;
; Description:      Waves the transparency of a window
; Parameter(s):     $hWin - Title of Window
; Requirement(s):   None
; Return Value(s):  On Success - Waves the windows transparency
;                   On Failure - 0 
;
; Author(s):        Nick Koontz (D-Generation X) (nick AT darkdragonspirit DOT net)
; Note(s): Do not use on flashing windows or if you are on ecstasy
;
;===============================================================================

Func WinTransWave($hWin)
    $Handle = WinGetHandle($hWin)
    If $Handle = "" Then
        Return 0 
    Else
        While 1
        For $i = 1 to 255 step +3
            WinSetTrans($Handle, "", $i)
        Next
        For $a = 255 to 1 step -3
            WinSetTrans($Handle, "", $a)
        Next
    WEnd
EndIf
EndFunc
oÝ÷ Ûøz·¢±«&jY^Å©©èºÚ"µÍÒ[ÛYH ][ÝÕ[ÕÜ]LÉ][ÝÂÜ
    ÌÎNÕÚ[]SX]Ú[ÙIÌÎNËBÚ[YR[  ][ÝÓ[Þ[HYÞ  ][ÝÊB

This would fade in Firefox.

Any other functions i should add?

Link to comment
Share on other sites

Heres a couple of wrappers i made for Transparency effects. I was just really bored and got ideas from the other transparency-related things lately.

Hey, I like these. I was looking at example scripts from a while ago and found this in one:

Func _WinFade($hWnd, $iStart, $iEnd, $iStep = 3, $iSleep = 1, $iFade = 1); $iFade - 1 = Fade Out - 0 = Fade In
    If $iFade Then
        For $iCount = $iStart To $iEnd Step - $iStep
            WinSetTrans($hWnd, '', $iCount)
            Sleep($iSleep)
        Next
        Return 1
    ElseIf Not $iFade Then
        For $iCount = $iStart To $iEnd Step $iStep
            WinSetTrans($hWnd, '', $iCount)
            Sleep($iSleep)
        Next
        Return 1
    EndIf
    Return SetError(1, 0, 0)
EndFunc

I forget who made it but it's nice...

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...