Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2005
    Posts
    63

    i can't get it right

    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 .

  2. #2
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    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

  3. #3
    Join Date
    Nov 2005
    Posts
    63
    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

  4. #4
    Join Date
    Jul 2002
    Location
    Just South of Reality
    Posts
    778
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts