Skip to content

Background bleeding through on individual screen images #44

@mikeclayton

Description

@mikeclayton

In the unit test code, some screen images have the background bleeding through around the top and right edges - e.g. this:

preview image

image

close-up

The green background is bleeding through between the screen image and the screen bezel

image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions