Skip to content

UIElement.Opacity has no effect on SKCanvasElement content #24367

Open

Description

@noknowscode

Summary

SKCanvasElement draws directly onto the window canvas and bypasses XAML opacity, so
setting Opacity on the element (or an ancestor) does nothing.

Measured

An SKCanvasElement filling its 40x40 area with opaque black, at Opacity="0.25", over a
white background:

centre pixel rgba(0,0,0,255) luma 0 — opacity honoured predicts ~191, bypassed ~0

If opacity were composited, the centre pixel would be roughly rgb(191,191,191). It is
pure black (luma 0) — the opacity was ignored entirely.

Expected

Opacity on an SKCanvasElement, or on any ancestor, composites its drawn output — or,
failing that, the limitation is documented and detectable.

Why this matters

Opacity is the standard mechanism for fading content in and out. Any entrance, exit or
disabled state built on it silently does nothing when the target is a Skia canvas, and
because the canvas still renders, the result looks like an animation bug rather than an
unsupported property.

Note this is not a general transform problem: the same element correctly rides a parent
Viewbox/ScaleTransform (verified separately, 100% ink for a 4x-scaled mark), so
scaling composites while opacity does not.

Workaround

Bake the alpha into the SKPaint colours inside RenderOverride.


Environment

Uno.Sdk 6.8.0-dev.87 · net10.0-desktop · .NET 10.0.11 · Windows 11 · Skia renderer

How this was measured

Reproduced by an automated capability probe rather than by hand, so the numbers above are
the probe's raw output. The probe asserts the claim in this issue and reports the measured
values, so it can be re-run against any SDK to confirm a fix.

Activity

  1. added
    kind/bug
    triage/untriaged
    on Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugtriage/untriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions