Page 1 of 1

Re: v2.0 Preview 0.1 RELEASED!

Posted: Mon Apr 01, 2019 10:23 am
by ScottM
I moved most of a small website to V2.0 preview. One thing isn't working for me, which is displaying images with XAML like this:

Code: Select all

<Image Source="ms-appx:/Resources/BSTSplash310x150x32bit.png" MinWidth="82" MinHeight="37" MaxWidth="310" MaxHeight="150" Stretch="Fill" Margin="20,20,10,0" HorizontalAlignment="Left"/>

I think this is due to the Properties / Build Action for the png file. In V1.2, I get these options:
V1.2.png
V1.2.png (4.31 KiB) Viewed 8113 times

and "Resource" works for me.

But in V2.0, I only see these options:
V2.0.png
V2.0.png (1.69 KiB) Viewed 8113 times

and Content and Embedded Resource don't work.

Is this a bug, or did I blunder?

Preview limted image Build Action options

Posted: Mon Apr 08, 2019 10:07 am
by ScottM
I posted this under the new release forum, perhaps it was the wrong place to do so?

viewtopic.php?f=6&t=8504#p10590

Briefly, under the new 2.0 preview, a PNG image only gives me these options: "None, Compile, Content, Embedded Resource". I don't see the simple "Resource" option that allowed me, in the current version, to display an Image using

Code: Select all

Source="ms-appx:/Resources/[blah, blah, balh].png"

in the XAML.

Is this a preview bug, or am I doing something wrong?

Re: Preview limted image Build Action options

Posted: Mon Apr 08, 2019 11:59 pm
by JS-Support @Userware
Hi,

Thanks for your post.

We could not reproduce this issue. Please find attached below (at the end of this post) a sample project that shows the 3 possible syntaxes:

Code: Select all

<!-- Absolute path with assembly name: -->
<Image Source="ms-appx:/TestCshtml5Bridge2/Resources/cshtml5_logo.png"/>
<!-- Absolute path without assembly name: -->
<Image Source="ms-appx:/Resources/cshtml5_logo.png"/>
<!-- Relative path: -->
<Image Source="Resources/cshtml5_logo.png"/>


Setting the "Build Action" to "Content" should work fine:
build_action_for_images.png
build_action_for_images.png (31.96 KiB) Viewed 7987 times


If the attached project works fine on your system, could you please attempt to modify it to reproduce your issue, and then upload it again?

Thanks
Regards

Re: Preview limted image Build Action options

Posted: Tue Apr 09, 2019 9:45 am
by ScottM
Thanks for the reply. I'll look into the other syntax options, as I can't run the project:

2019-04-09.png
2019-04-09.png (9.39 KiB) Viewed 7980 times


I'll play with it some more and report back.

Re: Preview limted image Build Action options

Posted: Tue Apr 09, 2019 10:48 am
by ScottM
OK, on one of the test websites, it's working in the simulator and the browser, but still doesn't show up in the preview pane.

In the other one, I get this:

ImagesProblem.png
ImagesProblem.png (48.05 KiB) Viewed 7978 times

The code for it is:

Code: Select all

<Image Source="Resources/BSTSplash310x150x32bit.png" MinWidth="82" MinHeight="37" MaxWidth="310" MaxHeight="150" Stretch="Fill" Margin="20,20,10,0" HorizontalAlignment="Left" />

I'll try and create it from scratch in the newer version of the preview to see if that helps.

Re: Preview limted image Build Action options

Posted: Tue Apr 09, 2019 11:10 am
by ScottM
Still no preview, but in the second test case, I fiddle with the image resolution of the first image, and then all three images started working in the simulator and browser. (Before I fiddled with the resolution of the first, none of the three showed up. Then only messing with the first, all three showed. Weird.)

Re: Preview limted image Build Action options

Posted: Tue Apr 09, 2019 11:41 pm
by JS-Support @Userware
Thanks. Glad it now works in both the browser and the simulator. The design-time "XAML preview pane" is unable to preview images at this time (this is a known limitation, likely addressed in the future).