Method SaveSurfaceToFile
SaveSurfaceToFile(SKSurface, string, SKEncodedImageFormat, int)
Saves the contents of the specified SKSurface to a file in the specified image format.
public static void SaveSurfaceToFile(SKSurface surface, string filePath, SKEncodedImageFormat format = SKEncodedImageFormat.Png, int quality = 100)
Parameters
surfaceSKSurfaceThe SKSurface containing the image to save.
filePathstringThe path of the file where the image will be saved. The file will be overwritten if it already exists.
formatSKEncodedImageFormatThe format in which to encode the image. The default is Png.
qualityintThe quality of the encoded image, ranging from 0 (lowest) to 100 (highest). This parameter is ignored for formats that do not support quality settings. The default is 100.
Remarks
This method captures the current state of the surface and encodes
it into the specified image format. The resulting image is then saved to the file at
filePath.