[UWP] Occasionally an image will display the wrong source, using the bounds of the correct source.

I have many images in my program with sources set to .png files. They all initially load correctly, but sometimes the images will change and display the contents of images I use elsewhere in my application. For example, I will create an image like this:

`

         _image = new Image
        {
            Aspect = Aspect.AspectFit,
            HorizontalOptions = LayoutOptions.CenterAndExpand,
            Source = "Assets/zoom_minus.png"
        };

`

It will initially load fine, but later while running it will change to be a cropped version of another image in the program. It's difficult to reproduce, and just seems to happen after the program has been running for a while. These examples are from an installed appx package, I've never seen this happening during debugging. Does anybody have any idea how to stop this happening? Below are some screenshots of icons loading incorrectly. Apparently a 3 year old account isn't old enough to post links, remove the spaces from the following URLs

us.v-cdn . net/5019960/uploads/editor/kp/ti9rncmpfop2.png
us.v-cdn . net/5019960/uploads/editor/25/tfhvkrm4w8yd.png
us.v-cdn . net/5019960/uploads/editor/z7/up9si9quxnt7.png
us.v-cdn . net/5019960/uploads/editor/jh/39n9t7b59nsu.png
us.v-cdn . net/5019960/uploads/editor/gq/daz5gpuf8tdl.png

Answers

  • Liêm_NguyễnLiêm_Nguyễn USMember ✭✭✭

    Do you have try put your image in root project. Not in Assets

Sign In or Register to comment.