Ejemplo n.º 1
0
        public static SKCodec Create(string filename, out SKCodecResult result)
        {
            var stream = SKFileStream.OpenStream(filename);

            if (stream == null)
            {
                result = SKCodecResult.InternalError;
                return(null);
            }

            return(Create(stream, out result));
        }
Ejemplo n.º 2
0
 public static SKTypeface FromFile(string path, int index = 0)
 {
     if (path == null)
     {
         throw new ArgumentNullException(nameof(path));
     }
     using (var stream = SKFileStream.OpenStream(path)) {
         if (stream == null)
         {
             return(null);
         }
         else
         {
             return(FromStream(stream, index));
         }
     }
 }
Ejemplo n.º 3
0
        public static SKData Create(string filename)
        {
            if (string.IsNullOrEmpty(filename))
            {
                throw new ArgumentException("The filename cannot be empty.", nameof(filename));
            }

            using (var stream = SKFileStream.OpenStream(filename)) {
                if (stream == null)
                {
                    return(null);
                }
                else
                {
                    return(Create(stream));
                }
            }
        }