question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Working alternative for PlatformImage for Maui.Graphics.IImage for Windows?

See original GitHub issue

Description

https://docs.microsoft.com/en-us/dotnet/maui/user-interface/graphics/images This sample shows how to load and work with image. The docs are not fully cross-platform. I need user to select an image and resize it on Windows. PlatformImage is not available on Windows. What is the suggested solution (working IImage implementation) for Windows?

image

image

Moreover, the docs say this:

Image loading functionality is provided by the GraphicsService class. Images can be loaded from a stream by the LoadFromStream method, or from a byte array using the LoadImageFromBytes method.

I cannot find any of these mentioned classes or methods. Is that a leftover from previous Preview version?

Thank you

Steps to Reproduce

Try get an IImage on Windows

Version with bug

Release Candidate 2 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

all?

Did you find any workaround?

not sure because SkiaImage isn’t finished image

other possible alternatives (have to check): image

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
drasticactionscommented, May 2, 2022

I might be reading this wrong but I think for Windows, PlatformImage is W2DImage (https://github.com/dotnet/Microsoft.Maui.Graphics/blob/main/src/Microsoft.Maui.Graphics.Win2D.WinUI.Desktop/W2DImage.cs). And instead of using PlatformImage, you should use IImage instead, since that’s the base image type for all of them.

@mattleibow does that sound right? It does seem weird that there is no direct PlatformImage for Windows that I can see.

0reactions
mattleibowcommented, May 11, 2022

The Skia* things is an alternative implementation that works across all platforms. You can either draw using win2d or skia.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Images - .NET MAUI
NET MAUI graphics includes functionality to load, save, resize, and downsize images.
Read more >
Microsoft.Maui.Graphics Alternatives and Reviews (Apr 2023)
Which is the best alternative to Microsoft.Maui.Graphics? Based on common mentions it is: ✓SkiaSharp and ✓FFImageLoading - Fast & Furious Image Loading.
Read more >
Bitmap object needed in MAUI.NET?
If I understand your means correctly, you can paint graphical objects in the Microsoft.Maui.Graphics namespace . First,Images can be drawn ...
Read more >
Is Maui dead on arrival? : r/dotnet
Since I want to be able to develop something for multiple platforms including webassembly, MAUI + Blazor seems to be the only option...
Read more >
Take Pictures in .NET MAUI with the Camera.MAUI ... - YouTube
DotNet MAUI MVVM: Deep Dive into MVVM Architecture with .NET MAUI · Highly Customizable Popups for .NET MAUI with Mopups ·.NET MAUI -...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found