public static ComObject <T> CreateBitmap <T>(this ComObject <ID2D1DeviceContext> device, D2D_SIZE_U size, IntPtr srcData, uint pitch, D2D1_BITMAP_PROPERTIES1 properties) where T : ID2D1Bitmap => CreateBitmap <T>(device?.Object, size, srcData, pitch, properties);
 public static ComObject <ID2D1Bitmap> CreateBitmap(this ComObject <ID2D1DeviceContext> device, D2D_SIZE_U size, D2D1_BITMAP_PROPERTIES1 properties) => CreateBitmap <ID2D1Bitmap>(device?.Object, size, IntPtr.Zero, 0, properties);
Esempio n. 3
0
 public static IComObject <ID2D1Bitmap> CreateBitmap(this IComObject <ID2D1DeviceContext> context, D2D_SIZE_U size, IntPtr srcData, uint pitch, D2D1_BITMAP_PROPERTIES1 properties) => CreateBitmap <ID2D1Bitmap>(context?.Object, size, srcData, pitch, properties);
        public static ComObject <T> CreateBitmap <T>(this ID2D1DeviceContext device, D2D_SIZE_U size, IntPtr srcData, uint pitch, D2D1_BITMAP_PROPERTIES1 properties) where T : ID2D1Bitmap
        {
            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }

            device.CreateBitmap(size, srcData, pitch, ref properties, out var bmp).ThrowOnError();
            return(new ComObject <T>((T)bmp));
        }
Esempio n. 5
0
 public static IComObject <T> CreateBitmap <T>(this IComObject <ID2D1DeviceContext> context, D2D_SIZE_U size, D2D1_BITMAP_PROPERTIES1 properties) where T : ID2D1Bitmap => CreateBitmap <T>(context?.Object, size, IntPtr.Zero, 0, properties);