public static SKColorFilter CreateColorCube(byte[] cubeData, int cubeDimension) { if (cubeData == null) { throw new ArgumentNullException(nameof(cubeData)); } return(CreateColorCube(SKData.CreateCopy(cubeData), cubeDimension)); }
public static SKImage FromPixelCopy(SKImageInfo info, byte[] pixels, int rowBytes) { if (pixels == null) { throw new ArgumentNullException(nameof(pixels)); } using (var data = SKData.CreateCopy(pixels)) { return(FromPixelData(info, data, rowBytes)); } }
public static SKImage FromEncodedData(byte[] data) { if (data == null) { throw new ArgumentNullException(nameof(data)); } if (data.Length == 0) { throw new ArgumentException("The data buffer was empty."); } using (var skdata = SKData.CreateCopy(data)) { return(FromEncodedData(skdata)); } }
internal static SKData FromCString(string str) { var bytes = Encoding.ASCII.GetBytes(str ?? string.Empty); return(SKData.CreateCopy(bytes, (ulong)(bytes.Length + 1))); // + 1 for the terminating char }