invertrect (user32)
Last changed: -211.154.168.34

.
Summary

C# Signature:

[DllImport("user32.dll")]
static extern bool InvertRect(IntPtr hDC, [In] ref RECT lprc);

VB Signature:

    Public Declare Function InvertRect Lib "user32" Alias "InvertRect" (ByVal hdc As Integer, <MarshalAs(UnmanagedType.Struct)> ByRef lpRect As RECT) As Integer

    <StructLayout(LayoutKind.Sequential)> Public Structure RECT
    Public Left As Integer
    Public Top As Integer
    Public Right As Integer
    Public Bottom As Integer
    End Structure

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

VB.NET

Public Overrides Sub draw(ByVal g As System.Drawing.Graphics, ByVal gc As GlyphContext)

    MyBase.draw(g, gc) '绘原图

    '绘制选择的部份
    '翻转
    If Selection.poStatus <> Selection.EnumSelection.NoSelection Then
        Dim hdc As IntPtr = g.GetHdc()

        Dim loSelected As RECT
        loSelected.Left = Selection.poArea.Left

        loSelected.Top = Selection.poArea.Top
        loSelected.Right = Selection.poArea.Right
        loSelected.Bottom = Selection.poArea.Bottom

        InvertRect(hdc.ToInt32, loSelected)

        ' Release handle to device context.
        g.ReleaseHdc(hdc)
    End If

    End Sub

Please add some!

Alternative Managed API:

Do you know one? Please contribute it!

Documentation
InvertRect on MSDN