Table of Contents

Method SaveAsPng

Namespace
LMKit.Media.Image
Assembly
LM-Kit.NET.dll

SaveAsPng(string, int)

Saves the image to a PNG file at the specified path, using the given compression level.

public bool SaveAsPng(string filePath, int compressionLevel = 6)

Parameters

filePath string

The file path where to save the PNG image.

compressionLevel int

Zlib deflate compression level, from 0 to 9:

  • 0 = no compression (fastest write, largest file)
  • 9 = maximum compression (slowest write, smallest file)
Default is 6, which offers a good balance between speed and file size.

Returns

bool

True if the image was saved successfully; otherwise, false.