Indigo Rose Software
Indigo Rose Software
Log in to the Customer Portal Customer Login
Software Development Discussion Forums Forums
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2010
    Posts
    3

    AutoPlay Media Studio 5. Function Image.GetFileInfo () does not work

    Hello
    I am from Russia. English is none. So I use Google translator. Sorry for bad language.
    In the AutoPlay Media Studio 7.5 theme is impossible to create. I ask the moderators to move my post where necessary.

    Description of the problem.
    The operator is used in two places:
    event OnShow
    code
    Code:
    s_pic = "AutoPlay\\Images\\banner.jpg";
    picatr = Image.GetFileInfo(s_pic);
    Image.SetSize("Image1", picatr.Width, picatr.Heigth);
    Image.Load("Image1", s_pic);
    Image.SetVisible("Image1", true);
    event OnCliCk button
    code
    Code:
    ...
    pic = File.Find("AutoPlay\\Images\\kuh", "*.jpg", false, false, nil);
    --Written to the table all the files in the folder
    
    count = Table.Count(pic);
    --Get the number
    
    i = 1;
    --We get up to the first position.
    --These values will be needed when you click another button later.
    
    picatr = Image.GetFileInfo(pic[i]);
    --Get the attributes of the current image.
    
    Image.SetSize("Image1", picatr.Width, picatr.Heigth);
    --give the size of the object
    
    Image.Load("Image1", pic[i]);
    --Load the current image into an object
    
    Image.SetVisible("Image1", true);
    Function Image.GetFileInfo () gives null values.
    He did try and see. Found that the variable gets picatr type Table. But NO values.

    During the application object Image1 not visible. Because it has no dimensions.

    What have I done wrong? I would be glad of any help.

  2. #2
    Join Date
    Feb 2009
    Posts
    602
    I first suggest you to check if any image has been found in File.Find(); use a if/else statement to show the results:
    Code:
    pic = File.Find("AutoPlay\\Images\\kuh", "*.jpg", false, false, nil);
    
    if not (pic[1] == nil) then
    -- put here the code you want to execute when files are found
    elseif (pic[1] == nil) then
    -- if the function returned nil then this message is displayed
    Dialog.Message("Error", "File.Find() returned a nil value");
    end

  3. #3
    Join Date
    Jul 2010
    Posts
    3
    To T3STY:
    Thank you very much for the tip! I will put you this fragment. But this is not the solution to my problem. Files there are exactly. Function File.find returns a list of files.
    Everything works fine until the function Image.GetFileInfo.
    Do you think that the rest of the code is correct?

  4. #4
    Join Date
    Aug 2003
    Posts
    2,131
    You have mis-typed the word Height.

    Code:
    s_pic = "AutoPlay\\Images\\banner.jpg";
    picatr = Image.GetFileInfo(s_pic);
    Image.SetSize("Image1", picatr.Width, picatr.Height);
    Image.Load("Image1", s_pic);
    Image.SetVisible("Image1", true);
    Try that.

    Same in both pieces of code.

  5. #5
    Join Date
    Jul 2010
    Posts
    3
    To longedge
    Thank you!
    Blame poor knowledge of English.
    The function works.

  6. #6
    Join Date
    Feb 2009
    Posts
    602
    oh man... so small difference, only one letter.. how couldn't I see it??

Posting Permissions

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