locked
<img src="pathtofile.png" /> isn't work

    Question

  • Hi everybody!

    IMG tag isn't work! I'm adding src but I only see img without image with "X" like is broken path. But my path is 100% is correct!

    <img src="images/logo.png" /> isn't work. How to solve?

    P.S. VS 2012 express, Win8 pro latest

    Tuesday, November 13, 2012 8:57 PM

Answers

All replies

  • Hi,

    Please set src as follow:

    <img src="ms-appx:///testimages/testimage1.png" />


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com
    Microsoft One Code Framework

    • Marked as answer by Song Tian Friday, November 16, 2012 1:50 AM
    Wednesday, November 14, 2012 2:38 AM
  • It doesn't work. I thinking its bug.
    Wednesday, November 14, 2012 8:09 AM
  • Hi,

    There is no problem on my side. Please check your project again. This is not a bug.


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com
    Microsoft One Code Framework

    Wednesday, November 14, 2012 8:44 AM
  • I'm making new blank project and add

    <img src="ms-appx:///images/image.png"/>

    it doesn't work. I know it must work but don't working!!


    • Edited by Pumano Wednesday, November 14, 2012 10:43 AM
    Wednesday, November 14, 2012 10:43 AM
  • how your solution looks?

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Wednesday, November 14, 2012 12:40 PM
  • Hi, I've had the same problem as you. The error was that the image file type extension was not correct. I used a tool (TrIDNET) to identify the correct file type and then I just changed the extension to the correct file type.

    E.g I had file that was "myimage.png", but was showing with an "X" just as you described. Using a tool I saw that "myimage" was a really a ".jpg" file. Then I just changed the file extension to ".jpg" and it worked, the image is showing correctly.

    Hope this helps!

    Wednesday, November 14, 2012 2:18 PM
  • I tried to rename but its not help me, but I found if I add  default logo.png or splashscreen.png they are workm but my personal is not work!
    Wednesday, November 14, 2012 9:17 PM
  • I found Solution!!! I'm adding images into application folder...but in Visual Studio in navigation tree I don't see that images..after copying images into IDE navigation (into images folder) I receive access for using.

    If IDE don't see image into local folder, they don't give access to image. Its a problem (I think)

    P. S. I'm newbie in Win8 development.

    Thank you for help


    • Edited by Pumano Wednesday, November 14, 2012 9:23 PM
    • Proposed as answer by Sky Kumar Tuesday, April 29, 2014 7:33 PM
    • Unproposed as answer by Sky Kumar Tuesday, April 29, 2014 7:33 PM
    Wednesday, November 14, 2012 9:22 PM
  • Here is the Working Solution For visual Studio for windows and For Visual studio for blend whichever IDE you use.
    If you are using Visual Studio for Windows.

    Click on show all files icon on Solution explorer to see those files which are not part of your project or the files that are included externally like images,folder,etc..

    Put your images say(images folder) then you will be able to see the image but won't be able to use with img tag to use it right click on the folder Go to add item and then add existing item and select the image you want to be included.
    and then you can use it with img tag... as normal you use it in browsers eg.

    <img src="/images/logo.png">

    no need to add ms-appx:/// before file path

    For Blend users....
    Do same thing right click on folder and add existing item.

    Tuesday, April 29, 2014 7:44 PM