Beispiel #1
0
 public void FillPath(D2DPathGeometry path, D2DColor fillColor)
 {
     D2D.FillPathD(path.Handle, fillColor);
 }
Beispiel #2
0
 public void ClosePath()
 {
     D2D.ClosePath(this.Handle);
 }
Beispiel #3
0
 public void DrawLine(D2DPoint start, D2DPoint end, D2DColor color,
                      FLOAT weight = 1, D2DDashStyle dashStyle = D2DDashStyle.Solid)
 {
     D2D.DrawLine(this.Handle, start, end, color, weight, dashStyle);
 }
Beispiel #4
0
 public void AddEllipse(D2DEllipse ellipse)
 {
     D2D.AddPathEllipse(this.Handle, ref ellipse);
 }
Beispiel #5
0
 public bool FillContainsPoint(D2DPoint point)
 {
     return(D2D.PathFillContainsPoint(this.Handle, point));
 }
Beispiel #6
0
 internal D2DBitmap(HANDLE handle)
     : base(handle)
 {
     this.Size = D2D.GetBitmapSize(handle);
 }
Beispiel #7
0
 public void AddLines(D2DPoint[] points)
 {
     D2D.AddPathLines(this.Handle, points);
 }
Beispiel #8
0
 public void Flush()
 {
     D2D.Flush(this.DeviceHandle);
 }
Beispiel #9
0
        public D2DBitmap GetBitmap()
        {
            HANDLE bitmapHandle = D2D.GetBitmapRenderTargetBitmap(this.Handle);

            return(bitmapHandle == HANDLE.Zero ? null : new D2DBitmap(bitmapHandle));
        }
Beispiel #10
0
 public void BeginRender(D2DBitmap bitmap)
 {
     D2D.BeginRenderWithBackgroundBitmap(this.DeviceHandle, bitmap.Handle);
 }
Beispiel #11
0
 public void EndRender()
 {
     D2D.EndRender(this.DeviceHandle);
 }
Beispiel #12
0
 public void BeginRender(D2DColor color)
 {
     D2D.BeginRenderWithBackgroundColor(this.DeviceHandle, color);
 }
Beispiel #13
0
 public void BeginRender()
 {
     D2D.BeginRender(this.DeviceHandle);
 }
Beispiel #14
0
 public void Clear(D2DColor color)
 {
     D2D.Clear(DeviceHandle, color);
 }
Beispiel #15
0
        public static D2DDevice FromHwnd(HWND hwnd)
        {
            HANDLE contextHandle = D2D.CreateContext(hwnd);

            return(new D2DDevice(contextHandle));
        }
Beispiel #16
0
 public void Dispose()
 {
     D2D.DestroyBitmapRenderTarget(this.Handle);
 }
Beispiel #17
0
        public D2DSolidColorBrush CreateSolidColorBrush(D2DColor color)
        {
            HANDLE handle = D2D.CreateSolidColorBrush(this.Handle, color);

            return(handle == HANDLE.Zero ? null : new D2DSolidColorBrush(handle, color));
        }
Beispiel #18
0
        public D2DRectangleGeometry CreateRectangleGeometry(ref D2DRect rect)
        {
            HANDLE rectHandle = D2D.CreateRectangleGeometry(this.Handle, ref rect);

            return(new D2DRectangleGeometry(this.Handle, rectHandle));
        }
Beispiel #19
0
 public void SetStartPoint(D2DPoint startPoint)
 {
     D2D.SetPathStartPoint(this.Handle, startPoint);
 }
Beispiel #20
0
        public D2DPathGeometry CreatePathGeometry()
        {
            HANDLE geoHandle = D2D.CreatePathGeometry(this.Handle);

            return(new D2DPathGeometry(this.Handle, geoHandle));
        }
Beispiel #21
0
 public void AddBeziers(D2DBezierSegment[] bezierSegments)
 {
     D2D.AddPathBeziers(this.Handle, bezierSegments);
 }
Beispiel #22
0
        public D2DBitmap LoadBitmap(byte[] buffer, UINT offset, UINT length)
        {
            var bitmapHandle = D2D.CreateBitmapFromBytes(this.Handle, buffer, offset, length);

            return((bitmapHandle != HWND.Zero) ? new D2DBitmap(bitmapHandle) : null);
        }
Beispiel #23
0
 public void AddArc(D2DPoint endPoint, D2DSize size, FLOAT sweepAngle,
                    D2D1_ARC_SIZE arcSize = D2D1_ARC_SIZE.D2D1_ARC_SIZE_SMALL,
                    D2D1_SWEEP_DIRECTION sweepDirection = D2D1_SWEEP_DIRECTION.D2D1_SWEEP_DIRECTION_CLOCKWISE)
 {
     D2D.AddPathArc(this.Handle, endPoint, size, sweepAngle, arcSize, sweepDirection);
 }
Beispiel #24
0
        public D2DBitmap LoadBitmap(string filepath)
        {
            var bitmapHandle = D2D.CreateBitmapFromFile(this.Handle, filepath);

            return((bitmapHandle != HWND.Zero) ? new D2DBitmap(bitmapHandle) : null);
        }
Beispiel #25
0
 public bool StrokeContainsPoint(D2DPoint point, FLOAT width = 1, D2DDashStyle dashStyle = D2DDashStyle.Solid)
 {
     return(D2D.PathStrokeContainsPoint(this.Handle, point, width, dashStyle));
 }
Beispiel #26
0
        public D2DBitmap CreateBitmapFromMemory(UINT width, UINT height, UINT stride, IntPtr buffer, UINT offset, UINT length)
        {
            HANDLE d2dbmp = D2D.CreateBitmapFromMemory(this.Handle, width, height, stride, buffer, offset, length);

            return(d2dbmp == HANDLE.Zero ? null : new D2DBitmap(d2dbmp));
        }
Beispiel #27
0
 public override void Dispose()
 {
     D2D.DestroyPathGeometry(this.Handle);
 }
Beispiel #28
0
 public void Dispose()
 {
     D2D.DestroyContext(this.Handle);
 }
Beispiel #29
0
 public void DrawLines(D2DPoint[] points, D2DColor color, FLOAT weight = 1, D2DDashStyle dashStyle = D2DDashStyle.Solid)
 {
     D2D.DrawLines(this.Handle, points, (uint)points.Length, color, weight, dashStyle);
 }
Beispiel #30
0
 public void DrawPath(D2DPathGeometry path, D2DColor strokeColor,
                      FLOAT strokeWidth = 1f, D2DDashStyle dashStyle = D2DDashStyle.Solid)
 {
     D2D.DrawPath(path.Handle, strokeColor, strokeWidth, dashStyle);
 }