Graphics.GetContextInfo Method

Definition

Overloads

GetContextInfo(PointF, Region)

Gets the cumulative offset and clip region.

GetContextInfo()
Obsolete.

Gets the cumulative graphics context.

GetContextInfo(PointF)

Gets the cumulative offset.

GetContextInfo(PointF, Region)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Gets the cumulative offset and clip region.

C#
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public void GetContextInfo(out System.Drawing.PointF offset, out System.Drawing.Region? clip);

Parameters

offset
PointF

When this method returns, contains the cumulative offset. This parameter is treated as uninitialized.

clip
Region

When this method returns, contains the cumulative clip region or null if the clip region is infinite. This parameter is treated as uninitialized.

Attributes

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
Windows Desktop 6, 7, 8, 9

GetContextInfo()

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Caution

Use the Graphics.GetContextInfo overloads that accept arguments for better performance and fewer allocations.

Gets the cumulative graphics context.

C#
[System.Obsolete("Use the Graphics.GetContextInfo overloads that accept arguments for better performance and fewer allocations.", DiagnosticId="SYSLIB0016", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public object GetContextInfo();
C#
public object GetContextInfo();

Returns

An Object representing the cumulative graphics context.

Attributes

Remarks

The return value is an object array where the first element contains the cumulative clip region and the second element contains the cumulative translate/transform matrix.

Applies to

.NET 9 (package-provided) and other versions
Product Versions (Obsolete)
.NET (8 (package-provided), 9 (package-provided))
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5 (6, 7, 8, 9)

GetContextInfo(PointF)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Gets the cumulative offset.

C#
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public void GetContextInfo(out System.Drawing.PointF offset);

Parameters

offset
PointF

When this method returns, contains the cumulative offset. This parameter is treated as uninitialized.

Attributes

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
Windows Desktop 6, 7, 8, 9