Sign in to follow this  
Followers 0
locutus243

Open Picture

4 posts in this topic

I have a folder on my D: drive which contains pictures. I want AutoIT to open a specified picture when I request it, pretty much like a FileOpen command, but FileOpen only opens text files. Is there another function that allows me to open pictures ???

Also is it possible to write a script that creates a input box and then allows you to input the picture I want to open. (In essence opening a input box and then using whatever is entered in there to determine what my script does!!)

Thanx for any help you can give

Mark

Share this post


Link to post
Share on other sites



like a FileOpen command, but FileOpen only opens text files

:ph34r:

when I request it

Aka you wanna have a dialog with your script ?!

That sample is from AU3's help

$message = "Hold down Ctrl or Shift to choose multiple files."

$var = FileOpenDialog($message, "C:\Windows\", "Images (*.jpg;*.bmp)", 1 + 4 )

If @error Then

MsgBox(4096,"","No File(s) chosen")

Else

$var = StringReplace($var, "|", @CRLF)

MsgBox(4096,"","You chose " & $var)

EndIf

Share this post


Link to post
Share on other sites

AutoIt does not open Images by itself. You can, however, open it with your favorite image viewer, launched by AutoIt.

for example:

$picture = Inputbox ("Enter Picture", "Which picture shall be opened?","test.jpg")
Run(@ProgramFilesDir & "\irfanview\i_view32.exe " & $picture

For the ease of use, I'd recommend using a "real" FileOpen Dialogue,

let's say

$picture = FileOpenDialog ("Which picture shall be opened?","", "*.jpg")

Hope it helps...

Marc


It's my job to comfort the disturbed and to disturb the comfortable.

Share this post


Link to post
Share on other sites

AutoIt does not open Images by itself. You can, however, open it with your favorite image viewer, launched by AutoIt.

for example:

$picture = Inputbox ("Enter Picture", "Which picture shall be opened?","test.jpg")
Run(@ProgramFilesDir & "\irfanview\i_view32.exe " & $picture

For the ease of use, I'd recommend using a "real" FileOpen Dialogue,

let's say

$picture = FileOpenDialog ("Which picture shall be opened?","", "*.jpg")

Hope it helps...

Marc

<{POST_SNAPBACK}>

well, you could have your script use SplashImageOn to display the picture, I think that Larry had posted some methods of getting a JPEG's dimensions which you could use to set the splash window's size...

SplashImageOn("TitleFoo", $picture)

"I'm not even supposed to be here today!" -Dante (Hicks)

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