Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 11 of 11
  1. #1
    Join Date
    Apr 2001
    Posts
    92

    image.load from ini values

    My following code is not working, I tried it in the "On Show" and "On preload" action of my main page:

    Code:
    Image.Load("Image1", "AutoPlay\\Images\\strimage");
    The variable "strimage" has the name of the image which I read from an INI file. If I replace "strimage" with the image file name, then it works. What am I doing wrong?

  2. #2
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Try this:

    Code:
    Image.Load("Image1", "AutoPlay\\Images\\" .. strimage);

    Quote Originally Posted by cchian
    My following code is not working, I tried it in the "On Show" and "On preload" action of my main page:

    Code:
    Image.Load("Image1", "AutoPlay\\Images\\strimage");
    The variable "strimage" has the name of the image which I read from an INI file. If I replace "strimage" with the image file name, then it works. What am I doing wrong?

  3. #3
    Join Date
    Apr 2001
    Posts
    92
    Hmm, still not working.

  4. #4
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    If that doesn't work, then my guess is that the variable isn't getting set, or the image isn't in the path you expect.

    Try using
    Dialog.Message("Debug", strimage);

    to display the value of the variable so you can see what you are working with.

    Quote Originally Posted by cchian
    Hmm, still not working.

  5. #5
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    I try to put the \\ before the AutoPlay folder as well.

    Image.Load("Image1", "\\AutoPlay\\Images\\" .. strimage);
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  6. #6
    Join Date
    Apr 2001
    Posts
    92
    I tried using
    Dialog.Message("Debug", strimage);

    and it does show file name correctly. The image is in the Autoplay\Images folder. I wonder if the Image.Load action doesn't accept variables?


    Quote Originally Posted by Worm
    If that doesn't work, then my guess is that the variable isn't getting set, or the image isn't in the path you expect.

    Try using
    Dialog.Message("Debug", strimage);

    to display the value of the variable so you can see what you are working with.

  7. #7
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Here I put together a very simple (one section, one value, and one data) AMS+.ini project together.

    I hope this helps at the very least to stimulate a workable solution.

    Attachment: INI-TEST-042604

    Sincerely,
    Attached Files
    Intrigued

  8. #8
    Join Date
    Apr 2001
    Posts
    92
    Intrigued,
    I could not compile your example because AMS it is telling me I am missing several plug-ins. By looking at you code I was able to make it work somewhat by placing images in the root and using this code:

    Image.Load("Image1", strimage);

    I still would like to find a way for AMS to see the images (using variables) if they are in the Autoplay\Images folder. Probably I am just not using the "correct" syntax, but have tried several ways.

    Thanks


    Quote Originally Posted by Intrigued
    Here I put together a very simple (one section, one value, and one data) AMS+.ini project together.

    I hope this helps at the very least to stimulate a workable solution.

    Attachment: INI-TEST-042604

    Sincerely,

  9. #9
    Join Date
    Feb 2004
    Location
    Washington DC Area
    Posts
    73
    I was able to load an image using a filename from an INI file in the following example.

    On Load Tab
    Code:
    -- Get filename from INI file
    ImageName = INIFile.GetValue("C:\\images.ini", "Images", "First");
    
    -- Load image into image place holder
    Image.Load("Image1", "AutoPlay\\Images\\"..ImageName);
    INI file
    Code:
    [Images]
    First=image1.png
    Attached Files
    Last edited by pjhiggins; 04-26-2004 at 12:39 AM. Reason: spelling goofs

  10. #10
    Join Date
    Apr 2001
    Posts
    92
    pjhiggins, your example worked. I will try to add your logic into my project.
    Thanks!

  11. #11
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Here is what I had:

    Code:
    INI File (In 'Docs' folder):
    
    [images]
    flowers="AutoPlay\\Images\\lilies.png"
    
    On PreLoad (Page1)
    
    selected_pic = INIFile.GetValue("AutoPlay\\Docs\\test.ini", "images", "flowers");
    
    On Show (Page1)
    
    Image.Load("Image1", selected_pic);
    
    Then Images (AutoPlay) Folder contains:
    
    lilies.png
    As far as the Plugin technologies still showing in the .apz file, sorry about that. I used "TESTPROJECT" for a lot of different projects and I just took that one and renamed it.

    The other .apz file offered is missing the INI file. Seems like another Export Project... that scraped off what files it thought were not in use. I sometimes forget to make sure to have AMS ask me what to disgard before a Export Project... batch processing episode, myself.

    Glad you have a working solution nontheless!
    Intrigued

Similar Threads

  1. regarding ini files
    By jhn9119 in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 01-02-2004, 02:10 PM
  2. Using XML Or INI files during install
    By djpyne in forum Setup Factory 6.0
    Replies: 0
    Last Post: 10-15-2003, 10:55 AM
  3. Echo values of variables and search for folders
    By tawi in forum AutoPlay Media Studio 4.0
    Replies: 2
    Last Post: 07-21-2003, 06:57 AM
  4. Ini files - getting value names, values
    By RobbyH in forum AutoPlay Media Studio 4.0
    Replies: 4
    Last Post: 02-14-2003, 08:52 AM
  5. A preference for including an external INI file
    By TimCarroll in forum Setup Factory 6.0
    Replies: 1
    Last Post: 07-22-2002, 10:38 AM

Posting Permissions

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