LEADTOOLS (Leadtools assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
LeadRect Structure
See Also  Members  
Leadtools Namespace : LeadRect Structure



Stores four integer numbers that represent the coordinates and size of a rectangle (X, Y, Width, and Height). Supported in Silverlight, Windows Phone 7

Object Model

LeadRect StructureLeadRect StructureLeadPoint StructureLeadSize Structure

Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Structure LeadRect 
   Inherits System.ValueType
Visual Basic (Usage)Copy Code
Dim instance As LeadRect
C# 
[SerializableAttribute()]
public struct LeadRect : System.ValueType 
C++/CLI 
[SerializableAttribute()]
public value class LeadRect : public System.ValueType 

Remarks

Various parts of the LEADTOOLS toolkit require a structure that represents a rectangle with location and size values. Although the .NET framework contains many structures that can be used for this such as System.Drawing.Rectangle and System.Windows.Rect they are tried to a specific platform (GDI+ and WPF/Silverlight in the previous case).

The LeadRect structure specifies a platform independent representation of a rectangle. If required, you can convert LeadRect to a platform independent rectangle.

To convert a GDI+ System.Drawing.Rectangle (source) to LeadRect, use can use the following code:

LeadRect dest = new LeadRect(source.X, source.Y, source.Width, source.Height)

To convert a LeadRect (source) to GDI+ System.Drawing.Rectangle, use can use the following code:

System.Drawing.Rectangle dest = new System.Drawing.Rectangle(source.X, source.Y, source.Width, source.Height)

To convert a WPF System.Windows.Rect (source) to LeadRect, use can use the following code:

LeadRect dest = new LeadRect((int)source.X, (int)source.Y, (int)source.Width, (int)source.Height)

To convert a LeadRect (source) to WPF System.Windows.Rect, use can use the following code:

System.Windows.Rect dest = new System.Windows.Rect(source.X, source.Y, source.Width, source.Height)

Inheritance Hierarchy

System.Object
   System.ValueType
      Leadtools.LeadRect

Requirements

Target Platforms: Silverlight, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only), Windows Phone 7

See Also