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

rect (Structures)
 
.
Summary
TODO - a short description

C# Signature:

/// <summary>Rectangle Structure</summary>
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
    public int left;
    public int top;
    public int right;
    public int bottom;

    public RECT(int left, int top, int right, int bottom)
    {
        this.left = left;
        this.top = top;
        this.right = right;
        this.bottom = bottom;
    }

    #region Operator overloads: Cast To And From System.Drawing.Rectangle

    /// <summary>Implicitly casts a RECT to a <see cref="Rectangle"/>.</summary>
    /// <param name="r">The <c>RECT</c> instance to cast to a <c>Rectangle</c>
    /// instance.</param>
    /// <returns>A new <c>Rectangle</c> structure.</returns>
    public static implicit operator Rectangle( RECT r )
    {
        return new Rectangle(r.left, r.top, r.right, r.bottom);
    }

    /// <summary>Implicitly casts a <see cref="Rectangle"/> to a <c>RECT</c>.</summary>
    /// <param name="r">The <c>Rectangle</c> instance to cast to a <c>RECT</c>
    /// instance.</param>
    /// <returns>A new <c>RECT</c> structure.</returns>
    public static implicit operator RECT( Rectangle r )
    {
        return new RECT(r.Left, r.Top, r.Right, r.Bottom);
    }

    #endregion
}

VB .NET Signature:

<StructLayout(LayoutKind.Sequential)> _

Public Structure RECT

  Public Left As Integer
  Public Top As Integer
  Public Right As Integer
  Public Bottom As Integer

End Structure

Public Shared Function ToRectangle(ByVal sourceRect As RECT) As Rectangle

  Return New Rectangle(sourceRect.Left, sourceRect.Top, sourceRect.Right - sourceRect.Left + 1, sourceRect.Bottom - sourceRect.Top + 1)

End Function

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

TODO

Documentation
RECT on MSDN

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

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