Jump to content

Picture path


trung0407
 Share

Recommended Posts

How can u get the path of a as a GUI Control?

Like

$Pic = GUICtrlCreatePic("C:\pic1.bmp", 27, 54, 32, 32)

How to get the "C:\pic1.bmp"? It's much easier when it's an object by accessing $Pic.Picture <_< ?!

There aren't properties in AutoIt like that. You will have to have a seperate variable for the path or make your own picture 'object'. For example you could have

Const $PicPic = 0,  $PicPath = 1, $PicName = 2, $LastPicElement = 2

$Pic = MyPic("C:\pic1.bmp", 27, 54, 32, 32,"Example pic")

msgbox(0,'the path for picture ' & $pic[$PicName] & ' is',$Pic[$PicPath])



Func MyPic ($path,$left,$right,$wid,$ht,$name)

Local $pp[LastPicElement + 1]

$pp[$PicPic] = GUICtrlCreatePic($path,$left,$right,$wid,$ht,$Name)
$pp[$PicPath] = $path
$pp[$PicName] = $Name
return $pp

EndFunc
Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I'm sure AutoIt doesn't accept "." in the variables <_<

....

He meant by using an object, did you even read his post?

It's much easier when it's an object by accessing $Pic.Picture

$obj = ObjCreate("blah")
$obj.Action(1)

Hope you were being sarcastic, really.

Kurt

Awaiting Diablo III..

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