예제 #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
파일: D2DGeometry.cs 프로젝트: yply/d2dlib
        // 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
파일: D2DLib.cs 프로젝트: hixio-mh/d2dlib
 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);
 }