View Full Version : i can't get it right
zaknbou
11-27-2006, 11:06 AM
i have a button(button 1) and a pic on my page (Image1), all i want to do is when i press the button i must got a message
with the size of the pic so :
on preload of the main page :result = Image.GetSize("Image1")
on the click of the button : Dialog.Message("size", result)
but it is not working ,
i notice that if the command connern the get opacity ,get filename or whatever single
result there will be no error but when the result should be 2 number like positon result = Image.GetPos("Image1") or size ....
i am getting an error
any help guys , thanks in advance .
yosik
11-27-2006, 12:19 PM
You know, you SHOULD read the manual/help file. It will.....help you...
As to your current question, size is a table, so you need to use result.Width and result.Height.
Yossi
zaknbou
11-28-2006, 11:12 AM
so dear sir what shall be the final script?? help me here i am trying
to figure how tables work ....i already see the help file but stuff
are hard to me i am a newbie :rolleyes
holtgrewe
11-28-2006, 12:14 PM
As Josik stated, by using the help we find:
__________________________________________________ _____
excerp from the help
Image.GetSize
Example 1
image_size = Image.GetSize("Image1");
Gets the pixel dimensions of the "Image1" image object and stores the width and height values in the "image_size" table. The dimensions can be accessed by referencing image_size.Width and image_size.Height.
__________________________________________________ _________
...and
Concatenating Strings
We have already covered string concatenation, but it is well worth repeating. The string concatenation operator is two periods in a row (..). For example:
FullName = "Bo".." Derek"; -- FullName is now "Bo Derek"
-- You can also concatenate numbers into strings
DaysInYear = 365;
YearString = "There are "..DaysInYear.." days in a year.";
Note that you can put spaces on either side of the dots, or on one side, or not put any spaces at all. For example, the following four lines will accomplish the same thing:
foo = "Hello " .. user_name;
foo = "Hello ".. user_name;
foo = "Hello " ..user_name;
foo = "Hello "..user_name;
__________________________________________________ _________
...so your code might look like this:
Dialog.Message("size: ", result.Width.." - "..result.Height)
I hope this helps.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.