Beispiel #1
0
		public SKBitmap (SKImageInfo info, SKBitmapAllocFlags flags)
			: this ()
		{
			if (!TryAllocPixels (info, flags)) {
				throw new Exception (UnableToAllocatePixelsMessage);
			}
		}
Beispiel #2
0
        public SKBitmap(SKImageInfo info, SKColorTable ctable, SKBitmapAllocFlags flags)
            : this()
        {
            var cinfo = SKImageInfoNative.FromManaged(ref info);

            if (!SkiaApi.sk_bitmap_try_alloc_pixels_with_color_table(Handle, ref cinfo, ctable != null ? ctable.Handle : IntPtr.Zero, flags))
            {
                throw new Exception(UnableToAllocatePixelsMessage);
            }
        }
Beispiel #3
0
        public bool TryAllocPixels(SKImageInfo info, SKBitmapAllocFlags flags)
        {
            var cinfo = SKImageInfoNative.FromManaged(ref info);

            return(SkiaApi.sk_bitmap_try_alloc_pixels_with_flags(Handle, ref cinfo, flags));
        }
Beispiel #4
0
 public SKBitmap(SKImageInfo info, SKColorTable ctable, SKBitmapAllocFlags flags)
     : this(info, SKBitmapAllocFlags.None)
 {
 }
Beispiel #5
0
        private bool TryAllocPixels(SKImageInfo info, SKColorTable ctable, SKBitmapAllocFlags flags = SKBitmapAllocFlags.None)
        {
            var cinfo = SKImageInfoNative.FromManaged(ref info);

            return(SkiaApi.sk_bitmap_try_alloc_pixels_with_color_table(Handle, ref cinfo, ctable != null ? ctable.Handle : IntPtr.Zero, flags));
        }