Exemplo n.º 1
0
        public static D2DBitmap CreateBitmapFromGDIBitmap(D2DDevice device, System.Drawing.Bitmap bmp)
        {
            bool useAlphaChannel =
                (bmp.PixelFormat & System.Drawing.Imaging.PixelFormat.Alpha) == System.Drawing.Imaging.PixelFormat.Alpha;

            return(device.CreateBitmapFromGDIBitmap(bmp, useAlphaChannel));
        }
Exemplo n.º 2
0
 internal D2DPen(D2DDevice Device, HANDLE handle, D2DColor color, D2DDashStyle dashStyle = D2DDashStyle.Solid,
                 float[] customDashes = null, float dashOffset = 0f)
     : base(handle)
 {
     this.Device       = Device;
     this.Color        = color;
     this.DashStyle    = dashStyle;
     this.CustomDashes = customDashes;
     this.DashOffset   = dashOffset;
 }
Exemplo n.º 3
0
 public D2DGraphics(D2DDevice context)
     : this(context.Handle)
 {
     this.Device = context;
 }
Exemplo n.º 4
0
        public static D2DBitmap CreateBitmapFromGDIBitmap(D2DDevice device, System.Drawing.Bitmap bmp, bool useAlphaChannel)
        {
            HANDLE d2dbmp = D2D.CreateBitmapFromHBitmap(device.Handle, bmp.GetHbitmap(), useAlphaChannel);

            return(d2dbmp == HANDLE.Zero ? null : new D2DBitmap(d2dbmp));
        }