Пример #1
0
        public D2DLayer PushLayer(D2DGeometry geometry = null)
        {
            // FIXME: resolve to not use magic number
            D2DRect rectBounds = new D2DRect(-999999, -999999, 999999999, 999999999);

            return(PushLayer(rectBounds, geometry));
        }
Пример #2
0
        public void DrawBitmap(D2DBitmap bitmap, D2DRect destRect, FLOAT opacity = 1,
                               D2DBitmapInterpolationMode interpolationMode      = D2DBitmapInterpolationMode.Linear)
        {
            var srcRect = new D2DRect(0, 0, bitmap.Width, bitmap.Height);

            this.DrawBitmap(bitmap, destRect, srcRect, opacity, interpolationMode);
        }
Пример #3
0
        // FIXME: TO be implemented
        //public void FillGeometry(D2DBrush brush, [Optional] D2DBrush opacityBrush)
        //{
        //  // TODO
        //}

        public D2DRect GetBounds()
        {
            var rect = new D2DRect();

            D2D.GetGeometryBounds(this.Handle, ref rect);
            return(rect);
        }
Пример #4
0
        public void DrawRectangle(FLOAT x, FLOAT y, FLOAT w, FLOAT h, D2DColor color, FLOAT strokeWidth = 1,
                                  D2DDashStyle dashStyle = D2DDashStyle.Solid)
        {
            D2DRect rect = new D2DRect(x, y, w, h);

            D2D.DrawRectangle(this.Handle, ref rect, color, strokeWidth, dashStyle);
        }
Пример #5
0
        public void DrawText(string text, D2DColor color, string fontName, float fontSize, FLOAT x, FLOAT y,
                             DWRITE_TEXT_ALIGNMENT halign      = DWRITE_TEXT_ALIGNMENT.DWRITE_TEXT_ALIGNMENT_LEADING,
                             DWRITE_PARAGRAPH_ALIGNMENT valign = DWRITE_PARAGRAPH_ALIGNMENT.DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
        {
            D2DRect rect = new D2DRect(x, y, 9999999, 9999999); // FIXME: avoid magic number

            D2D.DrawText(this.Handle, text, color, fontName, fontSize, ref rect, halign, valign);
        }
Пример #6
0
        public void DrawText(string text, D2DColor color, string fontName, float fontSize, FLOAT x, FLOAT y,
                             DWriteTextAlignment halign      = DWriteTextAlignment.Leading,
                             DWriteParagraphAlignment valign = DWriteParagraphAlignment.Near)
        {
            D2DRect rect = new D2DRect(x, y, 9999999, 9999999); // FIXME: avoid magic number

            D2D.DrawText(this.Handle, text, color, fontName, fontSize, ref rect, halign, valign);
        }
Пример #7
0
 public void DrawText(string text, D2DColor color, string fontName, float fontSize, D2DRect rect,
                      DWRITE_TEXT_ALIGNMENT halign      = DWRITE_TEXT_ALIGNMENT.DWRITE_TEXT_ALIGNMENT_LEADING,
                      DWRITE_PARAGRAPH_ALIGNMENT valign = DWRITE_PARAGRAPH_ALIGNMENT.DWRITE_PARAGRAPH_ALIGNMENT_NEAR)
 {
     D2D.DrawText(this.Handle, text, color, fontName, fontSize, ref rect, halign, valign);
 }
Пример #8
0
 public void DrawTextCenter(string text, D2DColor color, string fontName, float fontSize, D2DRect rect)
 {
     this.DrawText(text, color, fontName, fontSize, rect,
                   DWRITE_TEXT_ALIGNMENT.DWRITE_TEXT_ALIGNMENT_CENTER, DWRITE_PARAGRAPH_ALIGNMENT.DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
 }
Пример #9
0
 public static extern void DrawBitmapRenderTarget([In] HANDLE context, HANDLE bitmapRenderTarget, ref D2DRect rect,
                                                  FLOAT opacity = 1, D2DBitmapInterpolationMode interpolationMode = D2DBitmapInterpolationMode.Linear);
Пример #10
0
 public static extern void GetGeometryTransformedBounds(HANDLE pathCtx, ref D2DMatrix3x2 mat3x2, ref D2DRect rect);
Пример #11
0
 public static extern HANDLE CreateRectangleGeometry([In] HANDLE ctx, [In] ref D2DRect rect);
Пример #12
0
 public static extern void FillRectangleWithBrush(HANDLE context, ref D2DRect rect, HANDLE brush);
Пример #13
0
 public void FillRectangle(D2DRect rect, D2DColor color)
 {
     D2D.FillRectangle(this.Handle, ref rect, color);
 }
Пример #14
0
        public void FillRectangle(float x, float y, float width, float height, D2DColor color)
        {
            var rect = new D2DRect(x, y, width, height);

            this.FillRectangle(rect, color);
        }
Пример #15
0
 public void DrawRectangle(D2DRect rect, D2DPen strokePen, FLOAT strokeWidth = 1)
 {
     D2D.DrawRectangleWithPen(this.Handle, ref rect, strokePen.Handle, strokeWidth);
 }
Пример #16
0
 public void DrawRectangle(D2DRect rect, D2DColor color, FLOAT strokeWidth = 1,
                           D2DDashStyle dashStyle = D2DDashStyle.Solid)
 {
     D2D.DrawRectangle(this.Handle, ref rect, color, strokeWidth, dashStyle);
 }
Пример #17
0
 public void PushClip(D2DRect rect)
 {
     D2D.PushClip(this.Handle, ref rect);
 }
Пример #18
0
 public static extern void DrawRectangle(HANDLE context, ref D2DRect rect, D2DColor color,
                                         FLOAT weight = 1, D2DDashStyle dashStyle = D2DDashStyle.Solid);
Пример #19
0
 public static extern void FillRectangle(HANDLE context, ref D2DRect rect, D2DColor color);
Пример #20
0
 public void FillRectangle(D2DRect rect, D2DBrush brush)
 {
     D2D.FillRectangleWithBrush(this.Handle, ref rect, brush.Handle);
 }
Пример #21
0
 public static extern void DrawText([In] HANDLE context, [In] string text, [In] D2DColor color,
                                    [In] string fontName, [In] FLOAT fontSize, [In] ref D2DRect rect,
                                    [In] DWRITE_TEXT_ALIGNMENT halign      = DWRITE_TEXT_ALIGNMENT.DWRITE_TEXT_ALIGNMENT_LEADING,
                                    [In] DWRITE_PARAGRAPH_ALIGNMENT valign = DWRITE_PARAGRAPH_ALIGNMENT.DWRITE_PARAGRAPH_ALIGNMENT_NEAR);
Пример #22
0
 public static extern void DrawD2DBitmap(HANDLE context, HANDLE bitmap, ref D2DRect destRect, ref D2DRect srcRect,
                                         FLOAT opacity = 1, D2DBitmapInterpolationMode interpolationMode = D2DBitmapInterpolationMode.Linear);
Пример #23
0
 public static extern void DrawD2DBitmap(HANDLE context, HANDLE bitmap, ref D2DRect destRect);
Пример #24
0
        public D2DRectangleGeometry CreateRectangleGeometry(FLOAT width, FLOAT height)
        {
            var rect = new D2DRect(0, 0, width, height);

            return(CreateRectangleGeometry(ref rect));
        }
Пример #25
0
 public static extern void DrawGDIBitmapRect(HANDLE context, HANDLE bitmap,
                                             ref D2DRect destRect, ref D2DRect srcRect, FLOAT opacity = 1, bool alpha = false,
                                             D2DBitmapInterpolationMode interpolationMode             = D2DBitmapInterpolationMode.Linear);
Пример #26
0
 public void DrawBitmap(D2DBitmap bitmap, D2DRect destRect, D2DRect srcRect, FLOAT opacity = 1,
                        D2DBitmapInterpolationMode interpolationMode = D2DBitmapInterpolationMode.Linear)
 {
     D2D.DrawD2DBitmap(this.Handle, bitmap.Handle, ref destRect, ref srcRect, opacity, interpolationMode);
 }
Пример #27
0
        public D2DRectangleGeometry CreateRectangleGeometry(ref D2DRect rect)
        {
            HANDLE rectHandle = D2D.CreateRectangleGeometry(this.Handle, ref rect);

            return(new D2DRectangleGeometry(this.Handle, rectHandle));
        }
Пример #28
0
 public void DrawBitmap(D2DBitmapGraphics bg, D2DRect rect, FLOAT opacity = 1,
                        D2DBitmapInterpolationMode interpolationMode      = D2DBitmapInterpolationMode.Linear)
 {
     D2D.DrawBitmapRenderTarget(this.Handle, bg.Handle, ref rect, opacity, interpolationMode);
 }
Пример #29
0
 public static extern void PushClip([In] HANDLE context, [In] ref D2DRect rect,
                                    D2DAntialiasMode antiAliasMode = D2DAntialiasMode.PerPrimitive);
Пример #30
0
 public void DrawGDIBitmap(HANDLE hbitmap, D2DRect rect, D2DRect srcRect, FLOAT opacity = 1, bool alpha = false,
                           D2DBitmapInterpolationMode interpolationMode = D2DBitmapInterpolationMode.Linear)
 {
     D2D.DrawGDIBitmapRect(this.Handle, hbitmap, ref rect, ref srcRect, opacity, alpha, interpolationMode);
 }