SkiaSharp.SKCodec.Create C# (CSharp) Method

Create() public static method

public static Create ( SKData data ) : SKCodec
data SKData
return SKCodec
		public static SKCodec Create (SKData data)
		{
			if (data == null)
				throw new ArgumentNullException (nameof (data));
			return GetObject<SKCodec> (SkiaApi.sk_codec_new_from_data (data.Handle));
		}
	}

Same methods

SKCodec::Create ( SKStream stream ) : SKCodec

Usage Example

示例#1
0
 public static SKImage FromEncodedData(string filename)
 {
     if (filename == null)
     {
         throw new ArgumentNullException(nameof(filename));
     }
     using (var stream = SKBitmap.OpenStream(filename))
         using (var codec = SKCodec.Create(stream))
             using (var bitmap = SKBitmap.Decode(codec, codec.Info)) {
                 if (bitmap == null)
                 {
                     return(null);
                 }
                 return(FromBitmap(bitmap));
             }
 }
All Usage Examples Of SkiaSharp.SKCodec::Create