2 writes to NativeGraphics
System.Drawing.Common (2)
System\Drawing\Graphics.cs (2)
75NativeGraphics = gdipNativeGraphics; 185NativeGraphics = null;
142 references to NativeGraphics
System.Drawing.Common (142)
System\Drawing\Bitmap.cs (1)
93PInvokeGdiPlus.GdipCreateBitmapFromGraphics(width, height, g.NativeGraphics, &bitmap).ThrowIfFailed();
System\Drawing\Drawing2D\GraphicsPath.cs (2)
254graphics is null ? null : graphics.NativeGraphics, 284graphics is null ? null : graphics.NativeGraphics,
System\Drawing\Font.cs (1)
203if (graphics.NativeGraphics is null)
System\Drawing\Graphics.cs (130)
145CheckStatus(!Gdip.Initialized ? Status.Ok : PInvokeGdiPlus.GdipReleaseDC(NativeGraphics, (HDC)hdc)); 182if (NativeGraphics is not null) 184Status status = !Gdip.Initialized ? Status.Ok : PInvokeGdiPlus.GdipDeleteGraphics(NativeGraphics); 197nint IPointer<GpGraphics>.Pointer => (nint)NativeGraphics; 204CheckStatus(PInvokeGdiPlus.GdipGetClip(NativeGraphics, region.NativeRegion)); 215CheckStatus(PInvokeGdiPlus.GdipGetClipBounds(NativeGraphics, &rect)); 228CheckStatus(PInvokeGdiPlus.GdipGetCompositingMode(NativeGraphics, &mode)); 236CheckStatus(PInvokeGdiPlus.GdipSetCompositingMode(NativeGraphics, (GdiPlus.CompositingMode)value)); 245CheckStatus(PInvokeGdiPlus.GdipGetCompositingQuality(NativeGraphics, &quality)); 253CheckStatus(PInvokeGdiPlus.GdipSetCompositingQuality(NativeGraphics, (GdiPlus.CompositingQuality)value)); 262CheckStatus(PInvokeGdiPlus.GdipGetDpiX(NativeGraphics, &dpi)); 272CheckStatus(PInvokeGdiPlus.GdipGetDpiY(NativeGraphics, &dpi)); 285CheckStatus(PInvokeGdiPlus.GdipGetInterpolationMode(NativeGraphics, &mode)); 293CheckStatus(PInvokeGdiPlus.GdipSetInterpolationMode(NativeGraphics, (GdiPlus.InterpolationMode)value)); 302CheckStatus(PInvokeGdiPlus.GdipIsClipEmpty(NativeGraphics, &isEmpty)); 312CheckStatus(PInvokeGdiPlus.GdipIsVisibleClipEmpty(NativeGraphics, &isEmpty)); 322CheckStatus(PInvokeGdiPlus.GdipGetPageScale(NativeGraphics, &scale)); 325set => CheckStatus(PInvokeGdiPlus.GdipSetPageScale(NativeGraphics, value)); 333CheckStatus(PInvokeGdiPlus.GdipGetPageUnit(NativeGraphics, &unit)); 341CheckStatus(PInvokeGdiPlus.GdipSetPageUnit(NativeGraphics, (Unit)value)); 350CheckStatus(PInvokeGdiPlus.GdipGetPixelOffsetMode(NativeGraphics, &mode)); 358CheckStatus(PInvokeGdiPlus.GdipSetPixelOffsetMode(NativeGraphics, (GdiPlus.PixelOffsetMode)value)); 367CheckStatus(PInvokeGdiPlus.GdipGetRenderingOrigin(NativeGraphics, &x, &y)); 370set => CheckStatus(PInvokeGdiPlus.GdipSetRenderingOrigin(NativeGraphics, value.X, value.Y)); 378CheckStatus(PInvokeGdiPlus.GdipGetSmoothingMode(NativeGraphics, &mode)); 386CheckStatus(PInvokeGdiPlus.GdipSetSmoothingMode(NativeGraphics, (GdiPlus.SmoothingMode)value)); 395CheckStatus(PInvokeGdiPlus.GdipGetTextContrast(NativeGraphics, &textContrast)); 398set => CheckStatus(PInvokeGdiPlus.GdipSetTextContrast(NativeGraphics, (uint)value)); 409CheckStatus(PInvokeGdiPlus.GdipGetTextRenderingHint(NativeGraphics, &hint)); 417CheckStatus(PInvokeGdiPlus.GdipSetTextRenderingHint(NativeGraphics, (GdiPlus.TextRenderingHint)value)); 429CheckStatus(PInvokeGdiPlus.GdipGetWorldTransform(NativeGraphics, matrix.NativeMatrix)); 434CheckStatus(PInvokeGdiPlus.GdipSetWorldTransform(NativeGraphics, value.NativeMatrix)); 456CheckStatus(PInvokeGdiPlus.GdipGetWorldTransform(NativeGraphics, nativeMatrix)); 476CheckStatus(PInvokeGdiPlus.GdipSetWorldTransform(NativeGraphics, nativeMatrix)); 493CheckStatus(PInvokeGdiPlus.GdipGetDC(NativeGraphics, &hdc)); 514CheckStatus(PInvokeGdiPlus.GdipFlush(NativeGraphics, (GdiPlus.FlushIntention)intention)); 522CheckStatus(PInvokeGdiPlus.GdipSetClipGraphics(NativeGraphics, g.NativeGraphics, (GdiPlus.CombineMode)combineMode)); 533CheckStatus(PInvokeGdiPlus.GdipSetClipRect(NativeGraphics, rect.X, rect.Y, rect.Width, rect.Height, (GdiPlus.CombineMode)combineMode)); 540CheckStatus(PInvokeGdiPlus.GdipSetClipPath(NativeGraphics, path._nativePath, (GdiPlus.CombineMode)combineMode)); 547CheckStatus(PInvokeGdiPlus.GdipSetClipRegion(NativeGraphics, region.NativeRegion, (GdiPlus.CombineMode)combineMode)); 555NativeGraphics, 562CheckStatus(PInvokeGdiPlus.GdipSetClipRegion(NativeGraphics, region.NativeRegion, GdiPlus.CombineMode.CombineModeIntersect)); 568NativeGraphics, 575CheckStatus(PInvokeGdiPlus.GdipSetClipRegion(NativeGraphics, region.NativeRegion, GdiPlus.CombineMode.CombineModeExclude)); 579public void ResetClip() => CheckStatus(PInvokeGdiPlus.GdipResetClip(NativeGraphics)); 581public void TranslateClip(float dx, float dy) => CheckStatus(PInvokeGdiPlus.GdipTranslateClip(NativeGraphics, dx, dy)); 583public void TranslateClip(int dx, int dy) => CheckStatus(PInvokeGdiPlus.GdipTranslateClip(NativeGraphics, dx, dy)); 592CheckStatus(PInvokeGdiPlus.GdipIsVisiblePoint(NativeGraphics, x, y, &isVisible)); 605CheckStatus(PInvokeGdiPlus.GdipIsVisibleRect(NativeGraphics, x, y, width, height, &isVisible)); 614public void ResetTransform() => CheckStatus(PInvokeGdiPlus.GdipResetWorldTransform(NativeGraphics)); 627CheckStatus(PInvokeGdiPlus.GdipMultiplyWorldTransform(NativeGraphics, matrix.NativeMatrix, (GdiPlus.MatrixOrder)order)); 634CheckStatus(PInvokeGdiPlus.GdipTranslateWorldTransform(NativeGraphics, dx, dy, (GdiPlus.MatrixOrder)order)); 639CheckStatus(PInvokeGdiPlus.GdipScaleWorldTransform(NativeGraphics, sx, sy, (GdiPlus.MatrixOrder)order)); 644CheckStatus(PInvokeGdiPlus.GdipRotateWorldTransform(NativeGraphics, angle, (GdiPlus.MatrixOrder)order)); 654NativeGraphics, 689NativeGraphics, 745CheckErrorStatus(PInvokeGdiPlus.GdipDrawRectangle(NativeGraphics, pen.NativePen, x, y, width, height)); 770CheckErrorStatus(PInvokeGdiPlus.GdipDrawRectangles(NativeGraphics, pen.NativePen, (RectF*)r, rects.Length)); 795CheckErrorStatus(PInvokeGdiPlus.GdipDrawRectanglesI(NativeGraphics, pen.NativePen, (Rect*)r, rects.Length)); 812CheckErrorStatus(PInvokeGdiPlus.GdipDrawEllipse(NativeGraphics, pen.NativePen, x, y, width, height)); 838CheckErrorStatus(PInvokeGdiPlus.GdipDrawPie(NativeGraphics, pen.NativePen, x, y, width, height, startAngle, sweepAngle)); 869CheckErrorStatus(PInvokeGdiPlus.GdipDrawPolygon(NativeGraphics, pen.NativePen, (GdiPlus.PointF*)p, points.Length)); 894CheckErrorStatus(PInvokeGdiPlus.GdipDrawPolygonI(NativeGraphics, pen.NativePen, (GdiPlus.Point*)p, points.Length)); 908CheckErrorStatus(PInvokeGdiPlus.GdipDrawPath(NativeGraphics, pen.NativePen, path._nativePath)); 929CheckErrorStatus(PInvokeGdiPlus.GdipDrawCurve(NativeGraphics, pen.NativePen, (GdiPlus.PointF*)p, points.Length)); 952NativeGraphics, 988NativeGraphics, 1014CheckErrorStatus(PInvokeGdiPlus.GdipDrawCurveI(NativeGraphics, pen.NativePen, (GdiPlus.Point*)p, points.Length)); 1037NativeGraphics, 1070NativeGraphics, 1098NativeGraphics, 1129NativeGraphics, 1154NativeGraphics, 1180NativeGraphics, 1192public void Clear(Color color) => CheckStatus(PInvokeGdiPlus.GdipGraphicsClear(NativeGraphics, (uint)color.ToArgb())); 1226NativeGraphics, 1266CheckErrorStatus(PInvokeGdiPlus.GdipFillRectangles(NativeGraphics, brush.NativeBrush, (RectF*)r, rects.Length)); 1288CheckErrorStatus(PInvokeGdiPlus.GdipFillRectanglesI(NativeGraphics, brush.NativeBrush, (Rect*)r, rects.Length)); 1319NativeGraphics, 1358NativeGraphics, 1380NativeGraphics, 1429NativeGraphics, 1461NativeGraphics, 1502NativeGraphics, 1529NativeGraphics, 1565NativeGraphics, 1748NativeGraphics, 1809NativeGraphics, 1977NativeGraphics, 2001Status status = PInvokeGdiPlus.GdipDrawImage(NativeGraphics, image.Pointer(), x, y); 2011Status status = PInvokeGdiPlus.GdipDrawImageRect(NativeGraphics, image.Pointer(), x, y, width, height); 2066Status status = PInvokeGdiPlus.GdipDrawImagePoints(NativeGraphics, image.Pointer(), (GdiPlus.PointF*)p, count); 2083Status status = PInvokeGdiPlus.GdipDrawImagePointsI(NativeGraphics, image.Pointer(), (GdiPlus.Point*)p, count); 2094NativeGraphics, 2112NativeGraphics, 2140NativeGraphics, 2185NativeGraphics, 2238NativeGraphics, 2300NativeGraphics, 2377CheckErrorStatus(PInvokeGdiPlus.GdipDrawLines(NativeGraphics, pen.NativePen, (GdiPlus.PointF*)p, points.Length)); 2406CheckErrorStatus(PInvokeGdiPlus.GdipDrawLinesI(NativeGraphics, pen.NativePen, (GdiPlus.Point*)p, points.Length)); 2424CheckErrorStatus(PInvokeGdiPlus.GdipDrawLinesI(NativeGraphics, pen.NativePen, (GdiPlus.Point*)p, points.Length)); 2602NativeGraphics, 2628NativeGraphics, 2662PInvokeGdiPlus.GdipGetClip(NativeGraphics, regionHandle); 2666NativeGraphics, 2774CheckStatus(PInvokeGdiPlus.GdipGetNearestColor(NativeGraphics, &nearest)); 2784CheckErrorStatus(PInvokeGdiPlus.GdipDrawLine(NativeGraphics, pen.NativePen, x1, y1, x2, y2)); 2805NativeGraphics, 2836NativeGraphics, 2854NativeGraphics, 2871NativeGraphics, 2948NativeGraphics, 2977NativeGraphics, 3012NativeGraphics, 3041NativeGraphics, 3065NativeGraphics, 3106NativeGraphics, 3147NativeGraphics, 3180NativeGraphics, 3390CheckStatus(PInvokeGdiPlus.GdipGetVisibleClipBounds(NativeGraphics, &rect)); 3442Status status = PInvokeGdiPlus.GdipSaveGraphics(NativeGraphics, &state); 3460CheckStatus(PInvokeGdiPlus.GdipRestoreGraphics(NativeGraphics, (uint)gstate._nativeState)); 3469Status status = PInvokeGdiPlus.GdipBeginContainer(NativeGraphics, (RectF*)&dstrect, (RectF*)&srcrect, (Unit)unit, &state); 3488Status status = PInvokeGdiPlus.GdipBeginContainer2(NativeGraphics, &state); 3506CheckStatus(PInvokeGdiPlus.GdipEndContainer(NativeGraphics, (uint)container._nativeGraphicsContainer)); 3518CheckStatus(PInvokeGdiPlus.GdipComment(NativeGraphics, (uint)data.Length, b)); 3604NativeGraphics, 3636NativeGraphics,
System\Drawing\PointerExtensions.cs (1)
25public static GpGraphics* Pointer(this Graphics? graphics) => graphics is null ? null : graphics.NativeGraphics;
System\Drawing\Region.cs (7)
220CheckStatus(PInvokeGdiPlus.GdipGetRegionBounds(NativeRegion, g.NativeGraphics, &bounds)); 229CheckStatus(PInvokeGdiPlus.GdipGetRegionHRgn(NativeRegion, g.NativeGraphics, &hrgn)); 238CheckStatus(PInvokeGdiPlus.GdipIsEmptyRegion(NativeRegion, g.NativeGraphics, &isEmpty)); 247CheckStatus(PInvokeGdiPlus.GdipIsInfiniteRegion(NativeRegion, g.NativeGraphics, &isInfinite)); 256CheckStatus(PInvokeGdiPlus.GdipIsEqualRegion(NativeRegion, region.NativeRegion, g.NativeGraphics, &isEqual)); 292g is null ? null : g.NativeGraphics, 311g is null ? null : g.NativeGraphics,