Пример #1
0
 public unsafe Graphics(DeviceContext deviceContext)
 {
     GdiPlus.Init();
     Unsafe.SkipInit(out GpGraphics gpGraphics);
     Imports.GdipCreateFromHDC(deviceContext, &gpGraphics).ThrowIfFailed();
     _gpGraphics = gpGraphics;
 }
 public unsafe static extern GpStatus GdipFillEllipseI(
     GpGraphics graphics,
     GpBrush brush,
     int x,
     int y,
     int width,
     int height);
Пример #3
0
        public static void SetSmoothingMode(GpGraphics graphics, SmoothingMode smoothingMode)
        {
            GpStatus status = Imports.GdipSetSmoothingMode(graphics, smoothingMode);

            if (status != GpStatus.Ok)
            {
                throw GetExceptionForStatus(status);
            }
        }
Пример #4
0
        public static void FillEllipse(GpGraphics graphics, GpBrush brush, int x, int y, int width, int height)
        {
            GpStatus status = Imports.GdipFillEllipseI(graphics, brush, x, y, width, height);

            if (status != GpStatus.Ok)
            {
                throw GetExceptionForStatus(status);
            }
        }
Пример #5
0
        private unsafe static void DrawLines(GpGraphics graphics, GpPen pen, GpPoint *points, int count)
        {
            GpStatus status = Imports.GdipDrawLinesI(graphics, pen, points, count);

            if (status != GpStatus.Ok)
            {
                throw GetExceptionForStatus(status);
            }
        }
 public unsafe static extern GpStatus GdipDrawLinesI(
     GpGraphics graphics,
     GpPen pen,
     GpPoint *points,
     int count);
 public static extern GpStatus GdipSetSmoothingMode(
     GpGraphics graphics,
     SmoothingMode smoothingMode);
 public static extern GpStatus GdipCreateFromHDC(
     DeviceContext hdc,
     out GpGraphics graphics);
Пример #9
0
 ThrowIfFailed(Imports.GdipCreateFromHDC(deviceContext, out GpGraphics graphics));
Пример #10
0
 public unsafe static void DrawLines(GpGraphics graphics, GpPen pen, GpPoint[] points)
 {
     fixed(GpPoint *p = points)
     DrawLines(graphics, pen, p, points.Length);
 }
Пример #11
0
 public unsafe static void DrawLines(GpGraphics graphics, GpPen pen, POINT[] points)
 {
     fixed(POINT *p = points)
     DrawLines(graphics, pen, (GpPoint *)p, points.Length);
 }