public static SKImageInfo DecodeBounds(SKStreamRewindable stream, SKColorType pref = SKColorType.Unknown) { SKImageInfo info; SKImageDecoder.DecodeStreamBounds(stream, out info, pref); return(info); }
public SKImageDecoder(SKStreamRewindable stream) : this(SkiaApi.sk_imagedecoder_factory(stream.Handle)) { if (Handle == IntPtr.Zero) { throw new ArgumentException("Unable to find a decoder for the sream.", "stream"); } }
public static SKBitmap Decode(SKStreamRewindable stream, SKColorType pref = SKColorType.Unknown) { var bitmap = new SKBitmap(); if (!SKImageDecoder.DecodeStream(stream, bitmap, pref)) { bitmap.Dispose(); bitmap = null; } return(bitmap); }
public static bool DecodeStreamBounds(SKStreamRewindable stream, out SKImageInfo info, SKColorType pref, ref SKImageDecoderFormat format) { using (var bitmap = new SKBitmap()) { if (DecodeStream(stream, bitmap, pref, SKImageDecoderMode.DecodePixels, ref format)) { info = bitmap.Info; return(true); } info = SKImageInfo.Empty; return(false); } }
public static SKImageDecoderFormat GetFormat(SKStreamRewindable stream) { return(SkiaApi.sk_imagedecoder_get_stream_format(stream.Handle)); }
public static bool DecodeStream(SKStreamRewindable stream, SKBitmap bitmap, SKColorType pref, SKImageDecoderMode mode, ref SKImageDecoderFormat format) { return(SkiaApi.sk_imagedecoder_decode_stream(stream.Handle, bitmap.Handle, pref, mode, ref format)); }
public static bool DecodeStream(SKStreamRewindable stream, SKBitmap bitmap, SKColorType pref = SKColorType.Unknown, SKImageDecoderMode mode = SKImageDecoderMode.DecodePixels) { SKImageDecoderFormat format = SKImageDecoderFormat.Unknown; return(DecodeStream(stream, bitmap, pref, mode, ref format)); }
public static bool DecodeStreamBounds(SKStreamRewindable stream, out SKImageInfo info, SKColorType pref = SKColorType.Unknown) { SKImageDecoderFormat format = SKImageDecoderFormat.Unknown; return(DecodeStreamBounds(stream, out info, pref, ref format)); }