-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
area-controls-imageImage controlImage controli/great-reporterThis issue is opened by an author who is known to open high-quality issuesThis issue is opened by an author who is known to open high-quality issuespartner/syncfusionIssues / PR's with Syncfusion collaborationIssues / PR's with Syncfusion collaborationplatform/windowspotential-regressionThis issue described a possible regression on a currently supported version., verification pendingThis issue described a possible regression on a currently supported version., verification pendings/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
I just updated my GraphicsViewDemos project to .NET 8 and used PlatformImage.FromStream to load images on all platforms. Very nice!
In doing so I discovered a crash on Windows when you try and clip an image. It's this issue again. When you try to run clipping code you get an unhandled exception on Windows, with the message: "After calling CanvasDrawingSession.CreateLayer, you must close the resulting CanvasActiveLayer before ending the CanvasDrawingSession"
Both of the following code blocks cause the exception:
IImage image;
var assembly = GetType().GetTypeInfo().Assembly;
using (var stream = assembly.GetManifestResourceStream("GraphicsViewDemos.Resources.Images.dotnet_bot.png"))
{
image = PlatformImage.FromStream(stream);
}
if (image != null)
{
PathF path = new PathF();
path.AppendCircle(100, 90, 80);
canvas.ClipPath(path); // Must be called before DrawImage
canvas.DrawImage(image, 10, 10, image.Width, image.Height);
} IImage image;
var assembly = GetType().GetTypeInfo().Assembly;
using (var stream = assembly.GetManifestResourceStream("GraphicsViewDemos.Resources.Images.dotnet_bot.png"))
{
image = PlatformImage.FromStream(stream);
}
if (image != null)
{
canvas.SubtractFromClip(60, 60, 90, 90);
canvas.DrawImage(image, 10, 10, image.Width, image.Height);
}Steps to Reproduce
- Run the attached sample on Windows.
Link to public reproduction project repository
Version with bug
8.0.0-rc.2.9373
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
YZahringer, akhanalcs and rstarkov
Metadata
Metadata
Assignees
Labels
area-controls-imageImage controlImage controli/great-reporterThis issue is opened by an author who is known to open high-quality issuesThis issue is opened by an author who is known to open high-quality issuespartner/syncfusionIssues / PR's with Syncfusion collaborationIssues / PR's with Syncfusion collaborationplatform/windowspotential-regressionThis issue described a possible regression on a currently supported version., verification pendingThis issue described a possible regression on a currently supported version., verification pendings/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working