Пример #1
0
        public static SKCodec Create(SKStream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException(nameof(stream));
            }
            var codec = GetObject <SKCodec> (SkiaApi.sk_codec_new_from_stream(stream.Handle));

            stream.RevokeOwnership(codec);
            return(codec);
        }
Пример #2
0
        public static SKCodec Create(SKStream stream, out SKCodecResult result)
        {
            if (stream == null)
                throw new ArgumentNullException(nameof(stream));

            fixed(SKCodecResult *r = &result)
            {
                var codec = GetObject(SkiaApi.sk_codec_new_from_stream(stream.Handle, r));

                stream.RevokeOwnership(codec);
                return(codec);
            }
        }
Пример #3
0
        public static SKCodec Create(SKStream stream, out SKCodecResult result)
        {
            if (stream == null)
            {
                throw new ArgumentNullException(nameof(stream));
            }
            if (stream is SKFileStream filestream && !filestream.IsValid)
                throw new ArgumentException("File stream was not valid.", nameof(stream));

            fixed(SKCodecResult *r = &result)
            {
                var codec = GetObject(SkiaApi.sk_codec_new_from_stream(stream.Handle, r));

                stream.RevokeOwnership(codec);
                return(codec);
            }
        }
Пример #4
0
		public static SKCodec Create (SKStream stream)
		{
			if (stream == null)
				throw new ArgumentNullException (nameof (stream));
			var codec = GetObject<SKCodec> (SkiaApi.sk_codec_new_from_stream (stream.Handle));
			stream.RevokeOwnership (codec);
			return codec;
		}