Exemplo n.º 1
0
 public void FillPath(D2DPathGeometry path, D2DColor fillColor)
 {
     D2D.FillPathD(path.Handle, fillColor);
 }
Exemplo n.º 2
0
 public void ClosePath()
 {
     D2D.ClosePath(this.Handle);
 }
Exemplo n.º 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);
 }
Exemplo n.º 4
0
 public void AddEllipse(D2DEllipse ellipse)
 {
     D2D.AddPathEllipse(this.Handle, ref ellipse);
 }
Exemplo n.º 5
0
 public bool FillContainsPoint(D2DPoint point)
 {
     return(D2D.PathFillContainsPoint(this.Handle, point));
 }
Exemplo n.º 6
0
 internal D2DBitmap(HANDLE handle)
     : base(handle)
 {
     this.Size = D2D.GetBitmapSize(handle);
 }
Exemplo n.º 7
0
 public void AddLines(D2DPoint[] points)
 {
     D2D.AddPathLines(this.Handle, points);
 }
Exemplo n.º 8
0
 public void Flush()
 {
     D2D.Flush(this.DeviceHandle);
 }
Exemplo n.º 9
0
        public D2DBitmap GetBitmap()
        {
            HANDLE bitmapHandle = D2D.GetBitmapRenderTargetBitmap(this.Handle);

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

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

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

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

            return(new D2DPathGeometry(this.Handle, geoHandle));
        }
Exemplo n.º 21
0
 public void AddBeziers(D2DBezierSegment[] bezierSegments)
 {
     D2D.AddPathBeziers(this.Handle, bezierSegments);
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
 }
Exemplo n.º 24
0
        public D2DBitmap LoadBitmap(string filepath)
        {
            var bitmapHandle = D2D.CreateBitmapFromFile(this.Handle, filepath);

            return((bitmapHandle != HWND.Zero) ? new D2DBitmap(bitmapHandle) : null);
        }
Exemplo n.º 25
0
 public bool StrokeContainsPoint(D2DPoint point, FLOAT width = 1, D2DDashStyle dashStyle = D2DDashStyle.Solid)
 {
     return(D2D.PathStrokeContainsPoint(this.Handle, point, width, dashStyle));
 }
Exemplo n.º 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));
        }
Exemplo n.º 27
0
 public override void Dispose()
 {
     D2D.DestroyPathGeometry(this.Handle);
 }
Exemplo n.º 28
0
 public void Dispose()
 {
     D2D.DestroyContext(this.Handle);
 }
Exemplo n.º 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);
 }
Exemplo n.º 30
0
 public void DrawPath(D2DPathGeometry path, D2DColor strokeColor,
                      FLOAT strokeWidth = 1f, D2DDashStyle dashStyle = D2DDashStyle.Solid)
 {
     D2D.DrawPath(path.Handle, strokeColor, strokeWidth, dashStyle);
 }