-
Notifications
You must be signed in to change notification settings - Fork 3
Description
In the unit test code, some screen images have the background bleeding through around the top and right edges - e.g. this:
preview image
close-up
The green background is bleeding through between the screen image and the screen bezel
This is caused by sub-pixel smoothing when full-size screenshot images are stretched to fit the preview image. It only seems to be happening with the StaticImageRegionCopyService because that uses the Graphics class and GDI instead of Win32 StretchBlt.
See https://www.codeproject.com/Articles/14884/BorderBug for a discussion of this behaviour.
This can be fixed by drawing the preview screens with the following Graphics settings:
previewGraphics.PixelOffsetMode = PixelOffsetMode.Half;
previewGraphics.InterpolationMode = InterpolationMode.NearestNeighbor;
but this has to be done for only the DrawImage calls as all the bezel drawing will be offset to incorrect positions otherwise.

