예제 #1
0
 public unsafe Brush(ARGB color)
 {
     GdiPlus.Init();
     Unsafe.SkipInit(out GpBrush gpBrush);
     Imports.GdipCreateSolidFill(color, &gpBrush).ThrowIfFailed();
     _gpBrush = gpBrush;
 }
예제 #2
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;
 }
예제 #3
0
        public static GpSolidBrush CreateSolidBrush(ARGB color)
        {
            GpStatus status = Imports.GdipCreateSolidFill(color, out GpSolidBrush brush);

            if (status != GpStatus.Ok)
            {
                throw GetExceptionForStatus(status);
            }

            return(brush);
        }
예제 #4
0
        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);
예제 #7
0
 public static void Clear(this Graphics graphics, ARGB argb)
 => ThrowIfFailed(Imports.GdipGraphicsClear(graphics, argb));