/// <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
}
<StructLayout(LayoutKind.Sequential)> _
Public Structure RECT()
Left As Integer
Right As Integer
Top As Integer
Bottom As Integer
End Structure
Public Function ToRectangle() As Rectangle
Return New Rectangle(RECT.Left, RECT.Top, RECT.Right, RECT.Bottom)
End Function
None.
None.
Please add some!
Please add some!
TODO