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 unsafe Brush(ARGB color) { GdiPlus.Init(); Unsafe.SkipInit(out GpBrush gpBrush); Imports.GdipCreateSolidFill(color, &gpBrush).ThrowIfFailed(); _gpBrush = gpBrush; }
public unsafe Graphics(DeviceContext deviceContext) { GdiPlus.Init(); Unsafe.SkipInit(out GpGraphics gpGraphics); Imports.GdipCreateFromHDC(deviceContext, &gpGraphics).ThrowIfFailed(); _gpGraphics = gpGraphics; }
public void Dispose() { GC.SuppressFinalize(this); GdiPlus.Shutdown(_token); _token = UIntPtr.Zero; }
public GdiPlusSession(uint version = 2) { _token = GdiPlus.Startup(version); }