Sign in to follow this  
Followers 0
Swimming_Bird

Code stopped working when i chaned file location

7 posts in this topic

#1 ·  Posted (edited)

In order to make the pics go with me i made this code

#include "image_get_size_jpeg.au3"

$plainpic = @tempDir & "Sigstuff\Plain.jpg"
$openpic = @tempDir & "Sigstuff\06open.jpg"
$invpic =  @tempDir & "Sigstuff\inv_conf_05.jpg"

FileInstall ( "Plain.jpg" , $plainpic , 1 )
FileInstall ( "06open.jpg" , $openpic , 1 )
FileInstall ( "inv_conf_05.jpg" , $invpic , 1 )

;gets the image's resolution
$PlainSize = _ImageGetSizeJPG( $plainpic )
$OpenSize = _ImageGetSizeJPG( $openpic )
$InvSize = _ImageGetSizeJPG( $invpic )

$tab=GUICtrlCreateTab (-1,-1, 2000,1000)

$tab0=GUICtrlCreateTabitem ("Template")
;this tab has the user select the template they wish to use for their signature.
$plain = GUICtrlCreateRadio ("Plain", 8, 40, 50, 20)
$fbropen = GUICtrlCreateRadio ("FBR Open 2006", 60, 40, 110, 20)
$investor = GUICtrlCreateRadio ("Investor Conference", 175, 40, 130, 20)
$plain_pic  = GUICtrlCreatePic ( $plainpic , 25, 100, $PlainSize[0], $PlainSize[1])
$fbropen_pic  = GUICtrlCreatePic ($openpic, 25, 100, $OpenSize[0], $OpenSize[1])
$investor_pic = GUICtrlCreatePic ($invpic, 25, 100, $InvSize[0], $InvSize[1])

and i get this error

C:\Documents and Settings\tatlas\Desktop\Signatures Autoit\prelim script.au3 (44) : ==> Subscript used with non-Array variable.:

$plain_pic    = GUICtrlCreatePic ( $plainpic , 25, 100, $PlainSize[0], $PlainSize[1])

$plain_pic    = GUICtrlCreatePic ( $plainpic , 25, 100, $PlainSize^ ERROR

it works fine when i just run the images from the script directory, i cant confirm if it is installing the files propperly though.

Thx for even more help :)

image_get_size_jpeg.au3

Edited by Swimming_BIrd

Share this post


Link to post
Share on other sites



looks like you're defining the variable as an integer and not an array...

$PlainSize = _ImageGetSizeJPG( $plainpic )

$OpenSize = _ImageGetSizeJPG( $openpic )

$InvSize = _ImageGetSizeJPG( $invpic )

are integers and you're trying to use them as arrays...


If my posts or emails are not in the correct format, too bad! Technology is my territory!My Programming Page (I need members!):http://doublexlegion.gwgaming.net/

Share this post


Link to post
Share on other sites

looks like you're defining the variable as an integer and not an array...

$PlainSize = _ImageGetSizeJPG( $plainpic )

$OpenSize = _ImageGetSizeJPG( $openpic )

$InvSize = _ImageGetSizeJPG( $invpic )

are integers and you're trying to use them as arrays...

<{POST_SNAPBACK}>

they are arrays cuz when i just change the pic dir to the script's dir (which has the pics in it) it runs fine.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You state this

FileInstall ( "Plain.jpg" , $plainpic , 1 )

Help states this

FileInstall ( "source", "dest" [, flag] )

Parameters

source The source path of the file to compile. This must be a literal string; it cannot be a variable.

if you want to "Install files" what you used is ok, if the script and pics are in the same directory otherwise

FileInstall(C:\mydirectory\plain.jpg.....

this must be C:\......

not a variable

FileInstall is for compiling a script, if you are just "running" as an AU3 it does a "file copy" routine... you can check this

Hope it helps

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

basically i'm trying to figure out a way to "include" the pictures with my script when it is compiled. What i was planning on doing is installing the pictures to a temp directory and then reading them for the gui from there.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

i did have that error, but it after i fixed it it still didnt work :)

The issue seems to be that i am unable to place the files in this directory

Edited by Swimming_BIrd

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