Jump to content

Fading a picture


Recommended Posts

I have a script (that uses a fade function, I forget where I found it but it rocks! Thanks you whoever!) and I'm wondering if I can fade the picture. Here's the script...

#include <GUIConstants.au3>
GuiCreate("Hello",500, 500)
$pic = GuiCtrlCreatePic("Autoitback1.jpeg", 0, 0, 500, 500)
Guisetstate()

Global Const $AW_FADE_IN = 0x00080000 
Global Const $AW_FADE_OUT = 0x00090000

While 1
    $msg = guigetmsg()
        Select
            Case $msg = $GUI_Event_Close
                Exit
            Case $msg = $pic
                WinAnimate($pic, $AW_FADE_OUT)
        EndSelect
Wend        
                
                
Func WinAnimate($v_gui, $i_mode, $i_duration = 1000)
    If @OSVersion = "WIN_XP" Then
        DllCall("user32.dll", "int", "AnimateWindow", "hwnd", WinGetHandle($v_gui), "int", $i_duration, "long", $i_mode)
        Local $ai_gle = DllCall('kernel32.dll', 'int', 'GetLastError')
        If $ai_gle[0] <> 0 Then
            SetError(1)
            Return 0
        EndIf
        Return 1
    EndIf
EndFunc

This doesn't work as far as fading the picture goes...

Thanks, Piano_Man

Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

  • Moderators

http://www.autoitscript.com/forum/index.ph...st&p=213459

Edit:

One thing I would do is look at AnimateWindow in the search option:

http://www.autoitscript.com/forum/index.ph...e=AnimateWindow

Go through those threads to see if anyone else attempted it.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

http://www.autoitscript.com/forum/index.ph...st&p=213459

Edit:

One thing I would do is look at AnimateWindow in the search option:

http://www.autoitscript.com/forum/index.ph...e=AnimateWindow

Go through those threads to see if anyone else attempted it.

I didn't see anyone trying just a picture. Thanks for the help though, and thanks to you and gafrost for the two fading programs, they work nicely and I'll probably use them off and on in my programming...

If anyone finds a way to just fade a pic though that would be nice... also is there a way you can hide the handle? That way I could just make the whole Guibox a picture that I can click on to fade.

Piano_Man

Edit: I'm not sure if handles is what I meant, I mean all the part around a Guibox, I think those are the handles...

Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

  • Moderators

Edit: I'm not sure if handles is what I meant, I mean all the part around a Guibox, I think those are the handles...

If that's the case, then just look at GUI Control Styles in the help file $WS_POPUP as the style, and the pic as the background (disabled with GUICtrlSetState())

Edit:

The WinAnimate() will work then.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...