Board

Board.Save.ImageProcessor

ImageProcessor.ConvertToStandardizedPNG(Texture2D) Method

Converts a source texture to a standardized 432x243 PNG byte array for save game cover images. The image will be scaled and cropped to maintain aspect ratio and exact dimensions.

public static byte[] ConvertToStandardizedPNG(Texture2D sourceTexture);

Parameters

sourceTexture UnityEngine.Texture2D

The source texture to convert.

Returns

System.Byte[]
PNG byte array of the processed cover image.

Exceptions

System.ArgumentNullException
sourceTexture is null.

System.InvalidOperationException
Scaling and encoding image process fails.