Method EnsureSurface
EnsureSurface(int, int)
Ensures that a drawing surface with the specified dimensions is created and ready for use.
public void EnsureSurface(int width, int height)
Parameters
widthintThe width of the surface, in pixels. Must be greater than 0.
heightintThe height of the surface, in pixels. Must be greater than 0.
Remarks
If a surface already exists with the specified dimensions, this method does nothing. If the dimensions differ or no surface exists, the current surface is disposed and a new one is created. The surface is configured as a 32-bit BGRA top-down DIB (Device Independent Bitmap) with pre-multiplied alpha.
Exceptions
- Win32Exception
Thrown if a Win32 API call fails during the creation of the drawing surface.
- Exception
Thrown if the creation of the SkiaSharp surface fails.