Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 13 of 13
  1. #1
    Join Date
    Mar 2006
    Location
    Michigan
    Posts
    228

    Background image at load time

    Can anyone help with this, can't seem to get it to work.

    I am trying to load a background Image on a page at load time, but if the file does not exist then use internal color settings. I am trying to do this so i can change a background without rewriting the program. Below is the code I tried but it does not work. Any ideas ?

    Jerry


    -- Checks to see if Introduction Background.jpg file exists.
    ProgramIntro = File.DoesExist("autoplay\\Images\\Introduction Background.jpg");
    --If the Introduction Background.jpg file does not exist, Use Internal color settings.
    if ProgramIntro == false then
    -- Do Nothing and Use Internal color settings.
    else
    -- Load Page Background Image
    Image.Load("IntroPage", "AutoPlay\\Images\\Introduction Background.jpg");
    end

  2. #2
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629
    Quote Originally Posted by Jerryab
    Can anyone help with this, can't seem to get it to work.

    I am trying to load a background Image on a page at load time, but if the file does not exist then use internal color settings. I am trying to do this so i can change a background without rewriting the program. Below is the code I tried but it does not work. Any ideas ?

    Jerry


    -- Checks to see if Introduction Background.jpg file exists.
    ProgramIntro = File.DoesExist("autoplay\\Images\\Introduction Background.jpg");
    --If the Introduction Background.jpg file does not exist, Use Internal color settings.
    if ProgramIntro == false then
    -- Do Nothing and Use Internal color settings.
    else
    -- Load Page Background Image
    Image.Load("IntroPage", "AutoPlay\\Images\\Introduction Background.jpg");
    end
    Hi
    I'm not sure but perhaps it isn't working because the 'a' in ProgramIntro = File.DoesExist("autoplay\\Images\\Introduction Background.jpg"); is lowered.

  3. #3
    Join Date
    Dec 2003
    Posts
    891
    As Mina indicated, AMS is case sensitive.

  4. #4
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    AMS is case sensitive for code and variables, but when referencing file and folder paths it is not.

    "c:\\autoplay\\" == "C:\\AutoPlay\\" == "C:\\Autoplay\\"

    Jerry, I have seen issues with spaces in filenames. Try this:

    -- Checks to see if Introduction Background.jpg file exists.
    ProgramIntro = File.DoesExist("autoplay\\Images\\Introd~1.jpg");
    --If the Introduction Background.jpg file does not exist, Use Internal color settings.
    if ProgramIntro == false then
    -- Do Nothing and Use Internal color settings.
    else
    -- Load Page Background Image
    Image.Load("IntroPage", "AutoPlay\\Images\\Introd~1.jpg");
    end

    Or better yet, change the filename to one without spaces. I like to use an underscore in place_of_a_space in filenames.

    Since we're on the topic it is good policy to steer clear of pediods in your filename too... I hate that windows allows for this... just give users another way to hurt themselves and forces a ton of cursory use cases into our designs.
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  5. #5
    Join Date
    Mar 2006
    Location
    Michigan
    Posts
    228

    Still trying to get it to work.

    Thanks for the help people.

    Ok, I fixed all that was suggested and it still does not work.
    I even did a Dialog.Message to see if the file was even found and it was found.
    Is it even possible to load and image this way as a page background when starting the program or does it only work from PAGE Properties \ Settings \ Image ?



    -- Checks to see if Introduction_Background.jpg file exists.
    ProgramIntro = File.DoesExist("Autoplay\\Images\\Introduction_Bac kground.jpg");
    --If the Introduction_Background.jpg file does not exist, Use Internal color settings.
    if ProgramIntro == false then
    -- Do Nothing and Use Internal color settings.
    else
    -- Load Page Background Image
    Image.Load("IntroPage", "AutoPlay\\Images\\Introduction_Background.jpg ");
    end


    Jerry

  6. #6
    Join Date
    Mar 2006
    Location
    Michigan
    Posts
    228

    The line above shows Bac kground

    In the last post The line shows \\Introduction_Background.jpg but there really is no space in it, for some reason posting the message did that.

    And i even tried all lower case, that did not work either

    Jerry

  7. #7
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629
    Hi
    I can't think of a reason why this might not work. if it's ok, Could you export your apz?

  8. #8
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    Quote Originally Posted by Jerryab
    In the last post The line shows \\Introduction_Background.jpg but there really is no space in it, for some reason posting the message did that.

    And i even tried all lower case, that did not work either

    Jerry
    When posting code, if you use the CODE tags, you won't get those spaces.... plus your formatting will be preserved including indentation.

    Code:
    --Look at me!  I am some code!!!
    if Dude.IsCool(this) then
    Dialog.Message("Error", "Your too cool!");
    end
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  9. #9
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    This is a dumb question, but I've done it a million times.... are you sure the page is exactly "IntroPage" ?
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  10. #10
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629
    If IntroPage is a page's name, not an image object's name, then it's definitely not going to work

  11. #11
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    I would have a suggestion.
    Why not have an image ALWAYS loaded in a image object, but have said object invisible.
    Then , only if your background image exists, load it in the Image Object and make it visible?

    Good luck

    Yossi

  12. #12
    Join Date
    Mar 2006
    Location
    Michigan
    Posts
    228

    Background image not working

    The background is for the page (IntroPage) it's the name of the page, not an Object.

    For as simple as this should be it's become hard to do if possible at all.

    Any ideas on how this can be done, anyone ?

    Jerry

  13. #13
    Join Date
    Oct 2005
    Location
    American Dubai
    Posts
    629
    Here you go
    Attached Files

Similar Threads

  1. Tip: Missing easy Image Object (blank) Load?
    By Intrigued in forum AutoPlay Media Studio 6.0
    Replies: 3
    Last Post: 12-10-2005, 11:46 PM
  2. load random image?
    By Jonas DK in forum AutoPlay Media Studio 6.0
    Replies: 10
    Last Post: 10-17-2005, 09:34 PM
  3. changing background image
    By jack sparrow in forum AutoPlay Media Studio 5.0
    Replies: 6
    Last Post: 01-11-2005, 07:19 PM
  4. Menu image slow to load
    By hbuyer in forum AutoPlay Media Studio 5.0
    Replies: 7
    Last Post: 11-01-2004, 08:02 PM
  5. Background Image
    By rm22 in forum AutoPlay Menu Studio 3.0
    Replies: 3
    Last Post: 07-01-2002, 02:40 PM

Posting Permissions

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