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