コード例 #1
0
ファイル: D2DLib.cs プロジェクト: hixio-mh/d2dlib
        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));
        }
コード例 #2
0
ファイル: D2DPen.cs プロジェクト: yply/d2dlib
 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;
 }
コード例 #3
0
 public D2DGraphics(D2DDevice context)
     : this(context.Handle)
 {
     this.Device = context;
 }
コード例 #4
0
ファイル: D2DLib.cs プロジェクト: hixio-mh/d2dlib
        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));
        }