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.

IImage.Save (SkiaImage) not implemented

See original GitHub issue

This is a follow-on from #436. Building some code to replace System.Drawing.Common image manipulation for a ASP.NET 6 website running on Windows. Tried to take an IImage over to a byte array via a memory stream as shown here. The exact code doing this work is:

public static byte[] ConvertImageToByteArray(IImage imageToConvert, ImageFormat formatOfImage)
{
    byte[] ret;

    using (var ms = new MemoryStream())
    {
        imageToConvert.Save(ms, formatOfImage);
        ret = ms.ToArray();
    }

    return ret;
}

The IImage was extracted from a byte array using SkiaImage as shown in #436. The call to .Save() ends up with a PlatformNotImplementedException.

image

The same exception is thrown if the using block above is replaced with the AsBytes extension method:

ret = imageToConvert.AsBytes(formatOfImage);

Being that I’m using version 6.0.300 of both the Microsoft.Maui.Graphics and Microsoft.Maui.Graphics.Skia NuGet packages, I thought MAUI was up to feature complete status. Did this method get overlooked is is Skia not intended to support Windows?

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:5
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
swhardencommented, Oct 17, 2022

Are there plans to publish the GDI package?

I’d be more inclined to use and contribute to it if it were published on NuGet with the other packages

Read more comments on GitHub >

github_iconTop Results From Across the Web

SkiaImage Class (Microsoft.Maui.Graphics.Skia)
SkiaImage in the Microsoft.Maui.Graphics.Skia namespace. ... public class SkiaImage : IDisposable, Microsoft.Maui.Graphics.IImage
Read more >
c# - .NET 6/7 Migration from System.Drawing.Common to ...
On Linux or MacOS I can use the SkiaImage implementation. However it's not clear, how to achieve this. The documentation is currently very ......
Read more >
Image — skia-python 116.0b2 documentation
If Image is not texture backed, returns texture with Image contents. Parameters: context (skia.GrContext) – GPU context. image (skia.Image) – Image used for ......
Read more >
SkImage Class Reference
Makes image pixel data available to caller, possibly asynchronously. It can also rescale the image pixels. Currently asynchronous reads are only supported on ......
Read more >
Save files in graphics formats in Photoshop
Learn how to save or export Adobe Photoshop files to a variety of different image or graphics formats.
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