I'm currently porting some color dithering code to .NET Core 2.0 and SkiaSharp. What I'm currently trying to implement is the creation of a new SKBitmap with SKColorType
Index8 onto which I'll add the dithered pixels from the full-color source image. However, when using the following code:
SKBitmap b = new SKBitmap(320, 240, SKColorType.Index8, SKAlphaType.Opaque);
I get this message (pasted directly from VS 2017):
System.Exception occurred HResult=0x80131500 Message=Unable to allocate pixels for the bitmap. Source=<Cannot evaluate the exception source> StackTrace: at SkiaSharp.SKBitmap..ctor(SKImageInfo info, Int32 rowBytes) at SkiaSharp.SKBitmap..ctor(Int32 width, Int32 height, SKColorType colorType, SKAlphaType alphaType) at SkiaDitherTest.Program.Main(String args) in C:\Users\mcder\source\repos\SkiaDitherTest\SkiaDitherTest\Program.cs:line 16
I'll be the first to admit to being new to SkiaSharp, so I was wondering if there's a way to do what I need to do.....