locked
Beta blend not mapping image source paths correctly.

    Question

  • When choosing and image source path, Blend 2011 Beta doesnt seem to handle it correctly. When You choose an image source path from Blend 4, or from VS (any version) the path is correctly mapped relative to the control back to the image via a relative path. When you choose an image from the Blend beta, it mapps it as relative from the project root, but not from the relative path of the control.

    While blend does show the image correctly in the design view, at run time the image source is not loaded correctly.

    By design, bug, or what?

    Thanks,

    Matthew


    Sunday, April 22, 2012 12:46 AM

Answers

  • Thanks for reporting this issue. We have opened a bug on our end to track this.

    The workaround as you mentioned is to set the Source to "../"{relative Path from project} or "/"{relative Path from project}


    Dev@Mic


    Tuesday, May 15, 2012 11:56 PM

All replies

  • Hi Matthew,

    so I created a silverlight application, opened it in Blend, added an image control, changed the source property to a jpg in another directory from the solution and project and I get the following:

    <Image ... Source="image001.jpg"/>

    Sorry for the denseness on my part, could you jot down some steps to repro and/or report the issue at http://connect.microsoft.com/VisualStudio

    much appreciated,

    mike

    Thursday, April 26, 2012 8:59 PM
    Moderator
  • Create a new project, open in both VS and Blend.

    Create a new folder ( 'Images' ) and add an image to it.

    Create a new folder ( 'Display' ) and add an a new Page to it.

    Change the App.xaml.cs file to open the new page instead the default BlankPage.

    Add a image control the to blank page.

    ------------------------------------------------------------

    Now, set the image source for the image control. In either program the image source property has a drop down list associated with it, and when pressed shows the images that have been made resources of the project. You should see the image you added as a choice along with several default png files added with the project, without any reference to the files location (ie just the name of the file).

    If you set it in VS, you will see the image source path = "../Images/ImageName.jpg"

    If you set it in Blend, you will see the image source path = "Images/ImageName.jpg"

    Now regardless of which one in design time view you will see the image correctly rendered in the control. But only in the VS set mode will the image be displayed correctly at run time.

    If you reproduce this scenario in Windows7 with VS2010 and Blend4, you are able to set the image source in either program and have it map correctly. It ends up looking like "/PROJECT_NAME;component/Images/ImageName.jpg"

    This posses a problem because obviously it seems the setting the image source path in BetaBlend is not reliable, and the problem is only visable at run time.

    Thanks,

    Matt

    Thursday, April 26, 2012 9:47 PM
  • Thanks for reporting this issue. We have opened a bug on our end to track this.

    The workaround as you mentioned is to set the Source to "../"{relative Path from project} or "/"{relative Path from project}


    Dev@Mic


    Tuesday, May 15, 2012 11:56 PM