-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Working alternative for PlatformImage for Maui.Graphics.IImage for Windows? #6742
Comments
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 @mattleibow does that sound right? It does seem weird that there is no direct PlatformImage for Windows that I can see. |
@drasticactions similar for all other
I would work with |
I believe you access this via the IImageLoadingService Each platform has this service and you can either use DI or use the service directly to load images. This way, it doesn't matter what the platform image types are. Some method parameters or property types on some some images are platform specific so there is not a good way to expose this in a cross platform way. So we opted for a service that you request images from. |
@mattleibow
Is Which is the right service implementation for Windows - |
Ooh, looks like a typo in the service name... Use the one from the win2d namespace. I'll fix that and get it in for rc3. Sorry about that confusion |
I think RC is too late to change now 😢 @Redth? However, this is fixed in this PR for the servicing update with no breaking changes for you: dotnet/Microsoft.Maui.Graphics#420 |
@mattleibow well even if the Windows class name Is fixed, the class Is useless, it cannot load any image. Fails with something not registered during runtime And if it can load the image, can Win2DImage resize or downsize? I have seen just empty code in MAUI graphics repo. |
Thanks for that issue, I will have a look and see if I can get to this soon. |
Thank you, btw which platform does the
|
The Skia* things is an alternative implementation that works across all platforms. You can either draw using win2d or skia. |
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?Moreover, the docs say this:
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 WindowsVersion 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 finishedother possible alternatives (have to check):
Relevant log output
No response
The text was updated successfully, but these errors were encountered: