How to find the equivalent pixel format in skiasharp?

In system.drawing there is a pixelformat in which we have added the pixel format while creating the BITMAP.Kindly refer the below code.

Bitmap image = new Bitmap((int)width, (int)height, PixelFormat.Format1bppIndexed);
Since the system.Drawing is not supported in ASP.NET core we have used skiasharp.In which we cant find the pixel format for the bitmap.Kindly provide the equivalent pixelformat in skiasharp for below pixels.

PixelFormat.Format1bppIndexed
PixelFormat.Format32bppArgb
PixelFormat.Format8bppIndexed
PixelFormat.Format24bppRgb

Tagged:

Answers

  • EvrenGursoyEvrenGursoy USMember ✭✭

    Hi Mohan, this is probably what you are after (SKImageInfo is your helpful friend):

    SKBitmap bitmap = SKBitmap.Decode(your byte[] or other suitable parametre);

    bitmap.Info.ColorType;

Sign In or Register to comment.