ScreenExtensionsCreateDeviceContext Method
Creates a device context (DC) for the source
Screen
and returns a
IntPtr pointing to the created device context.
The device context is an opaque data structure, whose values are used internally by GDI.
You can use the returned
IntPtr in subsequent GDI functions to draw in the device context.
The device context must be released by calling the the
ReleaseDC(IntPtr, IntPtr) function.
Namespace: DevCase.Extensions.ScreenExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[EditorBrowsableAttribute(EditorBrowsableState.Always)]
public static IntPtr CreateDeviceContext(
this Screen sender
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Function CreateDeviceContext (
sender As Screen
) As IntPtr
Dim sender As Screen
Dim returnValue As IntPtr
returnValue = sender.CreateDeviceContext()
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static IntPtr CreateDeviceContext(
Screen^ sender
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member CreateDeviceContext :
sender : Screen -> IntPtr
No code example is currently available or this language may not be supported.
- sender Screen
-
The source Screen.
IntPtr
A
IntPtr pointing to the created device context.
In Visual Basic and C#, you can call this method as an instance method on any object of type
Screen. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This is a code example.
No code example is currently available or this language may not be supported.
Dim scr As Screen = Screen.PrimaryScreen
Dim hdc As IntPtr = scr.CreateDeviceContext()
' Release the device context.
NativeMethods.ReleaseDC(IntPtr.Zero, hdc)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.