Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

InvertRect (user32)
 
.
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:

Please add some!

VB.NET

Alternative Managed API:

Do you know one? Please contribute it!

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

Documentation
InvertRect on MSDN

    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

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions