Jump to content

GUI image and fade help


Recommended Posts

Hello,

i m new to auto it and i tried the search but still couldn't find related help. I m trying to make a startup guicreate at the start of my main script so the whole thing looks better. I want to make the gui fade in a 160,160 box with my image splash.bmp and disable the title bar.

And i also want it to fade out after 5 seconds (sleep 5000?)and then the main script will start. I think i can make the main script start after the "gui with the image" if i place the main one after the "gui with the image" (correct me if i m wrong).

Please help me with the script and i m also trying hard to learn how read them better so please help me make it.

Link to comment
Share on other sites

If you have any code please post it. I think I understand what you are talking about, but I am not sure. If you place some code in here I think I will be able to acertain for certain whether or not I can help.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Here's one way:

#include <GUIConstants.au3>

$splash = GUICreate("", 160, 160, -1, -1, $ws_popup)

For $trans = 0 To 255
    WinSetTrans($splash, "", $trans)
    GUISetState()
Next

Sleep(5000)
GUIDelete($splash)

GUICreate("Main Gui", 700, 500)
GUISetState()

Do
    Sleep(25)
Until GUIGetMsg() = $gui_event_close

AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.
Link to comment
Share on other sites

It worked thanks alot. But i also wanted it to display a picture. Sorry i m new so i need to ask such simple question. I think i would use this GUICtrlSetImage ( -1, "splash.bmp" )

i got this from another script and i dont know where to place this into and what the -1 is.

Link to comment
Share on other sites

#include <GUIConstants.au3>

$splash = GUICreate("", 160, 160, -1, -1, $ws_popup)
GUICtrlSetImage(-1, "splash.bmp")
For $trans = 0 To 255
    sleep(1)
    WinSetTrans($splash, "", $trans)
    GUISetState()
Next

Sleep(5000)
GUIDelete($splash)

GUICreate("Main Gui", 700, 500)
GUISetState()

Do
    Sleep(25)
Until GUIGetMsg() = $gui_event_close

The -1 just means to apply the guiSetImage() function to the last GUI form created, which in this case would be the splash screen. The -1 argument applies to almost all the AutoIt functions. It just means use the last created GUI or previous control.

Edit: I think GuiSetImage() is used for controls only, try GuiCtrlCreatePic()

GUICtrlCreatePic ( filename, left, top [, width [, height [, style [, exStyle]]]] )

try this:

GuiCtrlCreatePic("splash.bmp", 0, 0, 160, 160)
Edited by steveR
AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.
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...