Preview limted image Build Action options

Please post public support tickets here. Note: for private support tickets, please send an email to support@cshtml5.com instead.
ScottM
Posts: 38
Joined: Wed Mar 27, 2019 7:04 am

Re: v2.0 Preview 0.1 RELEASED!

Postby ScottM » Mon Apr 01, 2019 10:23 am

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 8107 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 8107 times

and Content and Embedded Resource don't work.

Is this a bug, or did I blunder?

ScottM
Posts: 38
Joined: Wed Mar 27, 2019 7:04 am

Preview limted image Build Action options

Postby ScottM » Mon Apr 08, 2019 10:07 am

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?

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: Preview limted image Build Action options

Postby JS-Support @Userware » Mon Apr 08, 2019 11:59 pm

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 7981 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
Attachments
TestCshtml5Bridge2.zip
(14.23 KiB) Downloaded 379 times

ScottM
Posts: 38
Joined: Wed Mar 27, 2019 7:04 am

Re: Preview limted image Build Action options

Postby ScottM » Tue Apr 09, 2019 9:45 am

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 7974 times


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

ScottM
Posts: 38
Joined: Wed Mar 27, 2019 7:04 am

Re: Preview limted image Build Action options

Postby ScottM » Tue Apr 09, 2019 10:48 am

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 7972 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.

ScottM
Posts: 38
Joined: Wed Mar 27, 2019 7:04 am

Re: Preview limted image Build Action options

Postby ScottM » Tue Apr 09, 2019 11:10 am

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.)

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: Preview limted image Build Action options

Postby JS-Support @Userware » Tue Apr 09, 2019 11:41 pm

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).


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 33 guests

 

 

cron