Microsoft.Maui.Graphics icon indicating copy to clipboard operation
Microsoft.Maui.Graphics copied to clipboard

[Windows] Fix DrawImage method

Open jsuarezruiz opened this issue 2 years ago • 3 comments

Fix DrawImage method on Windows

image

jsuarezruiz avatar Jun 22 '22 15:06 jsuarezruiz

We need this PR as a preliminary step to fix https://github.com/dotnet/Microsoft.Maui.Graphics/issues/250

jsuarezruiz avatar Jun 22 '22 15:06 jsuarezruiz

This adds a significant performance and memory hit. The library should be able to re-use the underlying native image representations, especially when you need to do something like tile an image.

jonlipsky avatar Jun 23 '22 16:06 jonlipsky

@hartez @jsuarezruiz This will need a more involved fix. The problem is that with Direct2D you have limitations about using resources between contexts. In some cases, the proposed solution would be acceptable but in most cases it's not acceptable from the aforementioned memory and performance issues.

I should have some time tomorrow to look at a permanent solution.

jonlipsky avatar Jun 23 '22 23:06 jonlipsky