Jump to content

JPEG RELOAD


 Share

Recommended Posts

Hello I was wondering if any one would be kind to help me

I am helping my friends raise money for DOE and they have

made a photo-booth we use 2 screens ( beeing split from 1 computer)

So I had an idea to make a autoit program

to show a .JPEG file, and to have the picture change In the autoit program

by changing the picture from the folder

(for example autoit reads folder/picture.jpeg so I want be able to delete the picture.jpeg

and paste a new picture and rename It to picture.jpeg and then auto It reload the picture automatically every few seconds or when the picture changes)

MY PROBLEM IS

I need autoit to reload the picture every few seconds can some one help please

my script Is

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#AutoIt3Wrapper_run_debug_mode=Y

#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Ivor Biggun\My Documents\Form1.kxf

$Form1 = GUICreate("Form1", 903, 644, 115, 59)

$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Ivor Biggun\My Documents\My Pictures\filsm\llun.jpg", 16, 8, 865, 625, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

GuiCtrlSetGraphic ($pic1, $GUI_GR_REFRESH)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

Link to comment
Share on other sites

Try this:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#AutoIt3Wrapper_run_debug_mode=Y

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Ivor Biggun\My Documents\Form1.kxf
$Form1 = GUICreate("Form1", 903, 644, 115, 59)
GUISetOnEvent($GUI_EVENT_CLOSE, "XClose")
$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Ivor Biggun\My Documents\My Pictures\filsm\llun.jpg", 16, 8, 865, 625, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GuiCtrlSetGraphic ($pic1, $GUI_GR_REFRESH)
GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###
While 1
    Sleep (1000)                            ;sleep 1 second
    GuiCtrlSetGraphic ($pic1, $GUI_GR_REFRESH);refresh the pic
WEnd

Func XClose()
    Exit
EndFunc

(changed to OnEventMode)

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

Try this:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#AutoIt3Wrapper_run_debug_mode=Y

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Ivor Biggun\My Documents\Form1.kxf
$Form1 = GUICreate("Form1", 903, 644, 115, 59)
GUISetOnEvent($GUI_EVENT_CLOSE, "XClose")
$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Ivor Biggun\My Documents\My Pictures\filsm\llun.jpg", 16, 8, 865, 625, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GuiCtrlSetGraphic ($pic1, $GUI_GR_REFRESH)
GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###
While 1
    Sleep (1000)                        ;sleep 1 second
    GuiCtrlSetGraphic ($pic1, $GUI_GR_REFRESH);refresh the pic
WEnd

Func XClose()
    Exit
EndFunc

(changed to OnEventMode)

hey thank you for the replie and code i will try it when i go to school ( because i built it there )

Link to comment
Share on other sites

echrom

Example:

#include <File.au3>

Dim $path = "c:\Pics"
Global $aPics = _FileListToArray($path, "*.gif", 1)
If @error Then Exit

Dim $count = 1

$hGUI = GUICreate("Relaod Image Example", 300, 200)

$pic = GUICtrlCreatePic($path & "\" & $aPics[1], 10, 10, 280, 180)

GUISetState()

AdlibEnable("_ReloadImg", 1000)

Do
Until GUIGetMsg() = -3

Func _ReloadImg()
    $count += 1
    If $count > $aPics[0] Then $count = 1
    GUICtrlSetImage($pic, $path & "\" & $aPics[$count])
EndFunc
Link to comment
Share on other sites

hey thanks for the code but it doesnt reload the pic at all any one else know how to do this i didnt think any 1 would find it hard

It should reload the pic. In your first post you specified a file name; I assumed that you will be permanent changing the picture in that folder keeping the same name for it, the code was desined to do that.

If you have many more files there and you need to change the pic (different files) then you have to specify it muttley

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

  • 1 month later...

It should reload the pic. In your first post you specified a file name; I assumed that you will be permanent changing the picture in that folder keeping the same name for it, the code was desined to do that.

If you have many more files there and you need to change the pic (different files) then you have to specify it :P

hey thanks but for some reason im having problems every time i change the picture in the directory (the same as specifed "with same name") it dosent change

if you close the program then reopen it it changed but the pointof the program is to leave it where it is and it will reload picture

SORRY FOR BEEING A NOOB im basicle a beginner at this

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