Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

[Windows] Fix DrawImage method #458

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Microsoft.Maui.Graphics.Win2D.WinUI.Desktop/W2DCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,10 @@ private CanvasBitmap CreatePatternBitmap(IPattern pattern)

public override void DrawImage(IImage image, float x, float y, float width, float height)
{
if (image is W2DImage platformImage)
var stream = image.AsStream();
var imageFromStream = W2DImage.FromStream(stream);

if (imageFromStream is W2DImage platformImage)
{
SetRect(x, y, width, height);

Expand Down