Bug 37237 - Changing Image.Source to another image of same size results in flicker on Windows
Summary: Changing Image.Source to another image of same size results in flicker on Win...
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.0.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-12-22 17:59 UTC by John Hardman
Modified: 2017-09-07 13:51 UTC (History)
4 users (show)

Tags: ac Image Source Flicker Redraw Windows WinPhone
Is this bug a regression?: ---
Last known good build:


Attachments
Source code that demonstrates issue (58.57 KB, text/plain)
2015-12-22 17:59 UTC, John Hardman
Details
Sample Project (1.53 MB, application/zip)
2016-01-04 18:35 UTC, John Miller [MSFT]
Details
updated project for android (1.56 MB, application/zip)
2017-09-07 13:01 UTC, David Ortinau [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description John Hardman 2015-12-22 17:59:19 UTC
Created attachment 14383 [details]
Source code that demonstrates issue

On Windows and WinPhone 8.1, changing Image.Source from one image to another of the same size, results in flicker. It appears that although the Source is never null, and the two images being used are the same size, there is a re-draw happening as if the Source is temporarily null. This results in controls that should be to the right of the Image being moved left and then right again, which causes the flicker.

To reproduce, use the attached source file. Create a Windows project. Add two images of the same size to the project, and store in the project folder with Content / Do Not Copy as properties. The images should be called "ic_unchecked_medium.png" and "ic_checked_medium.png" to match the source code.

Run the app, then tap on the image to the left of the text. Each time the image is tapped, the flicker occurs.

Note that there is a similar sounding bug in bugzilla - number 36600, which related to Android. Whilst it sounds similar, I suspect it is different, as the code supplied here does NOT seem to flicker on Android or iOS, only on Windows and WinPhone 8.1 (WinPhone tested in simulator).
Comment 1 John Miller [MSFT] 2016-01-04 18:35:34 UTC
Created attachment 14435 [details]
Sample Project

Adding a sample project that reproduces this. 

Run the WinApp project on Windows and click on the giant icon that is displayed. It will toggle back and forth between two images and there is a flicker.
Comment 2 John Hardman 2016-03-21 17:25:00 UTC
Still occurs on 2.1.0.6529
Comment 3 John Hardman 2016-03-23 18:16:41 UTC
In 2.1.0.6529, now also a problem on Android.
Comment 4 David Ortinau [MSFT] 2017-09-07 13:01:57 UTC
Created attachment 24620 [details]
updated project for android
Comment 5 David Ortinau [MSFT] 2017-09-07 13:04:32 UTC
I'm not able to reproduce a significant flicker. To avoid a new layout cycle on surrounding content, constrain the layout and/or image with a fixed Width/Height.

Tested with 2.4.0.269-pre2 on Android.

WP is deprecated.
Comment 6 John Hardman 2017-09-07 13:51:54 UTC
Just to confirm, I've not seen this for quite a while (although don't do WP any more).