Пример #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));