You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// BUG WORKAROUND: SKBitmapImageSource handles SKBitmap incorrectly under a lot of conditions, which are also platform dependent
363
+
// BUG WORKAROUND: SKBitmapImageSource handles SKBitmap incorrectly under a lot of conditions, which are also platform dependent - https://github.com/mono/SkiaSharp/issues/2466
363
364
// - Everywhere, including Windows: only sRGB color space is displayed correctly so results with linear actual color space must be converted to sRGB
364
365
// - On Android: ColorType.Argb4444 is displayed incorrectly
365
366
// - On Mac/iOS: Everything but Rgba8888/Premul works incorrectly. Actually applying the workaround for all non-Windows/Android systems just for sure.
Copy file name to clipboardexpand all lines: README.md
+27-14
Original file line number
Diff line number
Diff line change
@@ -274,25 +274,38 @@ bitmap.Unlock();
274
274
Thepreviousexampledemonstratedhowwecancreateamanagedaccessorfora `WriteableBitmap`. Butitworkedonlybecauseweusedapixelformatthathappenstohavebuilt-insupportalsoinKGySOFTDrawingLibraries. Infact, thelibrariesprovidesupportforanycustompixelformat. The [`CreateBitmapData`](https://docs.kgysoft.net/drawing/html/Overload_KGySoft_Drawing_Imaging_BitmapDataFactory_CreateBitmapData.htm) methods have several overloads that allow you to specify a custom pixel format along with a couple of delegates to be called when pixels are read or written:
275
275
276
276
```cs
277
-
// Gray8 format has no built-in support in KGySoft.Drawing.Core
277
+
// Though Gray8 format also has built-in support in KGySoft.Drawing.Core
278
+
// (see KnownPixelFormat.Format8bppGrayScale) here we pretend as if it was no supported natively.
279
+
// So this is our bitmap with the custom pixel format:
> 💡 _Tip:_Seealsothe [Xamarin](Examples/Xamarin) and [MAUI](Examples/Maui) examplesthatdemonstrate [how](https://github.com/koszeggy/KGySoft.Drawing/blob/8ac1a38317660a954ac6cf416c55d1fc3108c2fc/Examples/Maui/Extensions/SKBitmapExtensions.cs#L85) to create a bitmap data for SkiaSharp's `SKBitmap` type as if there was no dedicated package for SkiaSharp.
0 commit comments