locked
How to change image. Windows 8 Split App

    Question

  • I am working on Windows 8 Split App Project. How can I change the BackGround/Tile images.

    My Images are in this path "ProjectPage/Images/logo.png"

    In Data.js how do I provide the image path?

    // backgroundImage property in your real data to be URLs to images.
            var darkGray = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY3B0cPoPAANMAcOba1BlAAAAAElFTkSuQmCC";

    var sampleGroups = [
                { key: "Key 1", title: "Title 1", subtitle: "Common JS Tasks, ready to use", backgroundImage: darkGray, description: "" }
            ];


    Regards, Surya

    Sunday, December 16, 2012 5:39 PM

Answers

  • Hi Surya,

    Please refer to the following MSDN link:


    #How to load file resources (Windows Store apps using JavaScript and HTML) (Windows)
    http://msdn.microsoft.com/en-us/library/windows/apps/Hh781229(v=win.10).aspx



    For local resource file in your app project(package), you can use:

    • relative path (based on the current html page file)
    • absolute path from the projec root like "/images/my_pic.png"
    • absolute path with ms-appx:/// prefix like "ms-appx:///images/my_pic.png"

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Song Tian Friday, December 21, 2012 9:58 AM
    Monday, December 17, 2012 7:39 AM
    Moderator