private static IGraphics CreateSurface(byte[] buffer, BitmapImageType type) { if (!Graphics.HasDrawing()) { throw new NotSupportedException(); } return(new Internal.Bitmap(buffer, type)); }
extern public Bitmap(byte[] imageData, BitmapImageType type);
public extern Bitmap(byte[] imageData, int offset, int count, BitmapImageType type);
internal Graphics(byte[] buffer, int offset, int count, BitmapImageType type) : this(Graphics.CreateSurface(buffer, offset, count, type), IntPtr.Zero) { }
internal Graphics(byte[] buffer, BitmapImageType type) : this(Graphics.CreateSurface(buffer, type), IntPtr.Zero) { }