Example #1
0
 public static SKColorFilter CreateColorCube(byte[] cubeData, int cubeDimension)
 {
     if (cubeData == null)
     {
         throw new ArgumentNullException(nameof(cubeData));
     }
     return(CreateColorCube(SKData.CreateCopy(cubeData), cubeDimension));
 }
Example #2
0
 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));
     }
 }
Example #3
0
        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));
            }
        }
Example #4
0
        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
        }