Jump to content

random background picture


ashley
 Share

Recommended Posts

well i extended the 'random background color changer' (with some help) to make this:

a 'random background picture changer'

well here it is:

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.2.0
 Author:         ashley

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$GUI = GUICreate("random background picture", 604, 111, 193, 115)
$test = GUICtrlCreateLabel("This is a test to show you how to make a random background picture...", 40, 32, 546, 24)
$RBGpic = Random(1, 3, 1)
If $RBGpic = 1 Then 
     GUICtrlCreatePic("C:\Documents and Settings\Windows\Desktop\Picture one.bmp" , 0, 0, 604, 155, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
ElseIf $RBGpic = 2 Then 
    GUICtrlCreatePic("C:\Documents and Settings\Windows\Desktop\Picture two.bmp" , 0, 0, 604, 155, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
ElseIf $RBGpic = 3 Then 
    GUICtrlCreatePic("C:\Documents and Settings\Windows\Desktop\Picture three.bmp" , 0, 0, 604, 155, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
EndIf
GUISetState()
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

tell me what you think...

and the test pics are attached...

Link to comment
Share on other sites

do you men something like this

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.2.0
 Author:         ashley

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------



#include <GUIConstants.au3>
$Randomcolor = Random( 0xFFFFFF, 0x2B1B1B1, 0)
$randomfontsize = Random ( 8, 24)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 610, 105, 193, 115)
$Label1 = GUICtrlCreateLabel("this is too show you a random label color a font size", 0, 0, 610, 105)
GUICtrlSetColor(-1, $Randomcolor)
GUICtrlSetFont(-1, $randomfontsize , 400, 0, "Arial")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Edit = part of code missing...

Edited by ashley
Link to comment
Share on other sites

Most of the time i found your script useless since it's some random func that you combined. For the GUIBackground picture changer you should use @ScriptDir

and here?

#include <GUIConstants.au3>
Global $Form1
$Randomcolor = Random( 0xFFFFFF, 0x2B1B1B1, 1)
$randomfontsize = Random ( 8, 24)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 610, 105, 193, 115)
$Label1 = GUICtrlCreateLabel("this is too show you a random label color a font size", 0, 0, 610, 105)
GUICtrlSetColor(-1, $Randomcolor)
GUICtrlSetFont(-1, $randomfontsize , 400, 0, "Arial")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    _Random()
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
Func _Random()
    Local $Random=Random(0xFFFFFF, 0x2B1B1B1, 1)
    Hex($Random,8)
    GUISetBkColor($Random,$Form1)
EndFunc
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...