Example #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));
        }
Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #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);
 }
Example #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);
 }
Example #9
0
 public static extern void DrawBitmapRenderTarget([In] HANDLE context, HANDLE bitmapRenderTarget, ref D2DRect rect,
                                                  FLOAT opacity = 1, D2DBitmapInterpolationMode interpolationMode = D2DBitmapInterpolationMode.Linear);
Example #10
0
 public static extern void GetGeometryTransformedBounds(HANDLE pathCtx, ref D2DMatrix3x2 mat3x2, ref D2DRect rect);
Example #11
0
 public static extern HANDLE CreateRectangleGeometry([In] HANDLE ctx, [In] ref D2DRect rect);
Example #12
0
 public static extern void FillRectangleWithBrush(HANDLE context, ref D2DRect rect, HANDLE brush);
Example #13
0
 public void FillRectangle(D2DRect rect, D2DColor color)
 {
     D2D.FillRectangle(this.Handle, ref rect, color);
 }
Example #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);
        }
Example #15
0
 public void DrawRectangle(D2DRect rect, D2DPen strokePen, FLOAT strokeWidth = 1)
 {
     D2D.DrawRectangleWithPen(this.Handle, ref rect, strokePen.Handle, strokeWidth);
 }
Example #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);
 }
Example #17
0
 public void PushClip(D2DRect rect)
 {
     D2D.PushClip(this.Handle, ref rect);
 }
Example #18
0
 public static extern void DrawRectangle(HANDLE context, ref D2DRect rect, D2DColor color,
                                         FLOAT weight = 1, D2DDashStyle dashStyle = D2DDashStyle.Solid);
Example #19
0
 public static extern void FillRectangle(HANDLE context, ref D2DRect rect, D2DColor color);
Example #20
0
 public void FillRectangle(D2DRect rect, D2DBrush brush)
 {
     D2D.FillRectangleWithBrush(this.Handle, ref rect, brush.Handle);
 }
Example #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);
Example #22
0
 public static extern void DrawD2DBitmap(HANDLE context, HANDLE bitmap, ref D2DRect destRect, ref D2DRect srcRect,
                                         FLOAT opacity = 1, D2DBitmapInterpolationMode interpolationMode = D2DBitmapInterpolationMode.Linear);
Example #23
0
 public static extern void DrawD2DBitmap(HANDLE context, HANDLE bitmap, ref D2DRect destRect);
Example #24
0
        public D2DRectangleGeometry CreateRectangleGeometry(FLOAT width, FLOAT height)
        {
            var rect = new D2DRect(0, 0, width, height);

            return(CreateRectangleGeometry(ref rect));
        }
Example #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);
Example #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);
 }
Example #27
0
        public D2DRectangleGeometry CreateRectangleGeometry(ref D2DRect rect)
        {
            HANDLE rectHandle = D2D.CreateRectangleGeometry(this.Handle, ref rect);

            return(new D2DRectangleGeometry(this.Handle, rectHandle));
        }
Example #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);
 }
Example #29
0
 public static extern void PushClip([In] HANDLE context, [In] ref D2DRect rect,
                                    D2DAntialiasMode antiAliasMode = D2DAntialiasMode.PerPrimitive);
Example #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);
 }