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);
public static void SetSmoothingMode(GpGraphics graphics, SmoothingMode smoothingMode) { GpStatus status = Imports.GdipSetSmoothingMode(graphics, smoothingMode); if (status != GpStatus.Ok) { throw GetExceptionForStatus(status); } }
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); } }
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);
ThrowIfFailed(Imports.GdipCreateFromHDC(deviceContext, out GpGraphics graphics));
public unsafe static void DrawLines(GpGraphics graphics, GpPen pen, GpPoint[] points) { fixed(GpPoint *p = points) DrawLines(graphics, pen, p, points.Length); }
public unsafe static void DrawLines(GpGraphics graphics, GpPen pen, POINT[] points) { fixed(POINT *p = points) DrawLines(graphics, pen, (GpPoint *)p, points.Length); }