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

  • Question

  • User158686 posted

    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

    Thursday, April 4, 2019 7:20 PM

All replies

  • User272328 posted

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

    Friday, April 5, 2019 1:49 AM
  • User215894 posted

    @StephanBouthot said: 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

    Hi StephanBouthot, did you solve the problem?

    I too have encountered the same problem with an Xamarin Forms application, in the UWP project both in debug and release mode the images are exchanged with each other after a certain time of use of the application.

    Also in my case the images are not present in the project root but inside the Assets folder.

    Thank you

    Monday, February 10, 2020 2:16 PM
  • User344275 posted

    I have this issue with all of my images in the root folder. Does anyone have an update on this?

    Monday, March 9, 2020 8:51 PM