public unsafe Brush(ARGB color) { GdiPlus.Init(); Unsafe.SkipInit(out GpBrush gpBrush); Imports.GdipCreateSolidFill(color, &gpBrush).ThrowIfFailed(); _gpBrush = gpBrush; }
public unsafe Pen(ARGB color, float width = 1.0f, GpUnit unit = GpUnit.UnitWorld) { GdiPlus.Init(); Unsafe.SkipInit(out GpPen gpPen); Imports.GdipCreatePen1(color, width, unit, &gpPen).ThrowIfFailed(); _gpPen = gpPen; }
public static GpSolidBrush CreateSolidBrush(ARGB color) { GpStatus status = Imports.GdipCreateSolidFill(color, out GpSolidBrush brush); if (status != GpStatus.Ok) { throw GetExceptionForStatus(status); } return(brush); }
public static GpPen CreatePen(ARGB color, float width = 1.0f, GpUnit unit = GpUnit.UnitWorld) { GpStatus status = Imports.GdipCreatePen1(color, width, unit, out GpPen pen); if (status != GpStatus.Ok) { throw GetExceptionForStatus(status); } return(pen); }
public static extern GpStatus GdipCreateSolidFill( ARGB color, out GpSolidBrush brush);
public static extern GpStatus GdipCreatePen1( ARGB color, float width, GpUnit unit, out GpPen pen);
public static void Clear(this Graphics graphics, ARGB argb) => ThrowIfFailed(Imports.GdipGraphicsClear(graphics, argb));