Sign in to follow this  
Followers 0
BrettF

Changeable Picture

4 posts in this topic

#1 ·  Posted (edited)

OK. Heres what I want to do: When a user clicks a Button (entitled Browse), a dialouge box will open and then the user can select a picture file. Then once the box is closed the path will show in an input box. I have got this far as it is very simple. Then what i want it to do is show the picture selected in a GUI image in the current GUI. I have tried and tried but i cant make the image display in the GUI. What sould i do?

EDIT

Opps forgot the code. (The whole GUI is massive but anyway...)

#include <GUIConstants.au3>
Global $PicDir 
$Form1 = GUICreate("PDB- Installer Creator", 632, 521, 193, 115)
$Pic1 = GUICtrlCreatePic($PicDir, 16, 24, 145, 250, BitOR($SS_NOTIFY,$WS_GROUP)); The picture
$Input1 = GUICtrlCreateInput("Title", 168, 81, 113, 21)
$Input2 = GUICtrlCreateInput("Side Pic", 168, 41, 113, 21); The input Box
$Input3 = GUICtrlCreateInput("AInput1", 168, 121, 113, 21)
$Input4 = GUICtrlCreateInput("AInput4", 384, 305, 233, 21)
$Input5 = GUICtrlCreateInput("AInput1", 168, 161, 113, 21)
$Input6 = GUICtrlCreateInput("AInput1", 168, 201, 113, 21)
$Label1 = GUICtrlCreateLabel("Side Picture (Acutual Size)", 168, 24, 163, 17)
$Label2 = GUICtrlCreateLabel("Installer Title", 168, 64, 163, 17)
$Label3 = GUICtrlCreateLabel("Installer Icon (32x32)", 168, 104, 163, 17)
$Label4 = GUICtrlCreateLabel("Title:", 352, 304, 27, 17)
$Label5 = GUICtrlCreateLabel("Text:", 352, 328, 28, 17)
$Label6 = GUICtrlCreateLabel("Defult Installation Path", 168, 144, 163, 17)
$Label7 = GUICtrlCreateLabel("Start Menu Deafult Name", 168, 184, 163, 17)
$List1 = GUICtrlCreateList("", 16, 304, 129, 201)
$List2 = GUICtrlCreateList("", 240, 304, 89, 84)
$Edit1 = GUICtrlCreateEdit("", 352, 24, 265, 241)
GUICtrlSetData(-1, "AEdit1")
$Edit2 = GUICtrlCreateEdit("", 352, 344, 265, 161)
GUICtrlSetData(-1, "AEdit2")
$Group1 = GUICtrlCreateGroup("Installer Settings:", 8, 8, 329, 273)
$Group2 = GUICtrlCreateGroup("Files To Install:", 8, 288, 217, 225)
$Group3 = GUICtrlCreateGroup("Drives to Burn to:", 232, 288, 105, 113)
$Group4 = GUICtrlCreateGroup("License of Software:", 344, 8, 281, 273)
$Group5 = GUICtrlCreateGroup("Welcome Screen Text:", 344, 288, 281, 225)
$Button1 = GUICtrlCreateButton("Remove", 152, 336, 57, 25, 0)
$Button2 = GUICtrlCreateButton("Browse", 288, 40, 41, 25, 0); The button entitled Browse...
$Button3 = GUICtrlCreateButton("Browse", 288, 120, 41, 25, 0)
$Button4 = GUICtrlCreateButton("Add", 152, 304, 57, 25, 0)
$Button5 = GUICtrlCreateButton("Browse", 288, 160, 41, 25, 0)
$Button6 = GUICtrlCreateButton("Browse", 288, 200, 41, 25, 0)
$Button7 = GUICtrlCreateButton("Preview", 232, 408, 105, 25, 0)
$Button8 = GUICtrlCreateButton("Burn Protected Disc", 232, 440, 105, 41, 0)
$Button9 = GUICtrlCreateButton("About", 232, 488, 105, 25, 0)
GUISetState(@SW_SHOW)
While 1
    $Msg = GUIGetMsg()
    Select 
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $Button1

        Case $msg = $Button2
        $pic = FileOpenDialog ( "Select Side Splash, 250x145:", "", "Images (*.jpg;*.bmp;*.gif)")
        GUICtrlSetData ( $Input2 ,$pic)
        Case $msg = $Button3
        FileOpenDialog ( "Select Side Splash, 250x145:", "", "Images (*.jpg;*.bmp;*.gif)")
        GUICtrlSetData ( $Input2 ,$pic)
        Case $msg = $Button4

        Case $msg = $Button5
        FileOpenDialog ( "Select Side Splash, 250x145:", "", "Images (*.jpg;*.bmp;*.gif)")
        GUICtrlSetData ( $Input2 ,$pic)
        Case $msg = $Button6
        FileOpenDialog ( "Select Side Splash, 250x145:", "", "Images (*.jpg;*.bmp;*.gif)")
        GUICtrlSetData ( $Input2 ,$pic)
        Case $msg = $Button7

        Case $msg = $Button8

        Case $msg = $Button9

    EndSelect
WEnd
Edited by bert

Share this post


Link to post
Share on other sites



look a this little example:

#include <guiconstants.au3>

GUICreate("images",400,300,204,120)
$image = GUICtrlCreatePic("",10,10,300,110)
$text = GUICtrlCreateLabel("test",10,140,300,200)
GUISetState()

$file = FileOpenDialog ( "Choose a file", @scriptdir, "Images (*.jpg;*.bmp;*.gif)" )
GUICtrlSetImage($image,$file)
GUICtrlSetData($text,$file)

While 1
    $msg = GUIGetMsg()
    Select
        case $msg = $GUI_EVENT_CLOSE
        Exit
    EndSelect
WEnd

Neo :P


[center][font="Arial"]--- The Neo and Only --- [/font][font="Arial"]--Projects---[/font]Image to Text converterText to ASCII converter[/center]

Share this post


Link to post
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
Sign in to follow this  
Followers 0