Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.
This repository was archived by the owner on May 15, 2024. It is now read-only.

[Bug] UWP Needs to cache pixels instead of the bitmap, as RenderTargetBitmap may lose its content. #1448

@Mrnikbobjeff

Description

@Mrnikbobjeff

Description

The UWP Screenshot implementation has a bug where under certain conditions the content of the ScreenshotResult can be lost before being read as a stream. The RenderTargetBitmap docs solution is to call RenderTarget again, which would in effect take a screenshot at a later time. To prevent random losses of UWP screenshots we would have to store something else than a RenderTargetBitmap.

The contents of a RenderTargetBitmap can be lost in rare cases because of interaction with other lower-level systems, for example if the video driver is reset as part of a recovery (see Timeout Detection and Recovery (TDR)). If that happens, the CompositionTarget.SurfaceContentsLost event will fire. To account for this case and similar info-loss cases, apps should listen for the CompositionTarget.SurfaceContentsLost event and re-render the contents of a RenderTargetBitmap by calling RenderAsync again.

Expected Behavior

Bitmap is not lost after graphic driver reset

Actual Behavior

Bitmap is lost

Basic Information

  • Version with issue: 1.6.0 pre-2
  • Last known good version: -
  • IDE: -
  • Platform Target Frameworks:
    • UWP: All versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions