C# Class System.Drawing.Dimension

The Dimension class encapsulates the width and height of a component (in int precision) in a single object.
The class is associated with certain properties of components. Several methods defined by the Component class and the LayoutManager interface return a Dimension object.

Normally the values of width and height are non-negative ints. The constructors that allow you to create a dimension do not prevent you from setting a negative value for these properties. If the value of width or height is negative, the behavior of some methods defined by other objects is undefined.

Inheritance: System.Drawing.Dimension2D
Afficher le fichier Open project: red-gate/iTextSharp-4.1.6 Class Usage Examples

Méthodes publiques

Свойство Type Description
height int
width int

Méthodes publiques

Méthode Description
Dimension ( ) : System

Creates an instance of Dimension with a width of zero and a height of zero.

Dimension ( Dimension d ) : System

Creates an instance of Dimension whose width and height are the same as for the specified dimension.

Dimension ( int width, int height ) : System

Constructs a Dimension and initializes it to the specified width and specified height.

Equals ( Object obj ) : bool

Checks whether two dimension objects have equal values.

GetHashCode ( ) : int

Returns the hash code for this Dimension.

SetSize ( double width, double height ) : void

Set the size of this Dimension object to the specified width and height in double precision.

SetSize ( int width, int height ) : void

Set the size of this Dimension object to the specified width and height.

ToString ( ) : string

Returns a string representation of the values of this Dimension object's height and width fields.

This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Method Details

Dimension() public méthode

Creates an instance of Dimension with a width of zero and a height of zero.
public Dimension ( ) : System
Résultat System

Dimension() public méthode

Creates an instance of Dimension whose width and height are the same as for the specified dimension.
public Dimension ( Dimension d ) : System
d Dimension /// the specified dimension for the /// width and /// height values. ///
Résultat System

Dimension() public méthode

Constructs a Dimension and initializes it to the specified width and specified height.
public Dimension ( int width, int height ) : System
width int the specified width dimension
height int the specified height dimension
Résultat System

Equals() public méthode

Checks whether two dimension objects have equal values.
public Equals ( Object obj ) : bool
obj Object
Résultat bool

GetHashCode() public méthode

Returns the hash code for this Dimension.
public GetHashCode ( ) : int
Résultat int

SetSize() public méthode

Set the size of this Dimension object to the specified width and height in double precision.
public SetSize ( double width, double height ) : void
width double the new width for the Dimension object
height double the new height for the Dimension object
Résultat void

SetSize() public méthode

Set the size of this Dimension object to the specified width and height.
public SetSize ( int width, int height ) : void
width int the new width for this Dimension object.
height int the new height for this Dimension object.
Résultat void

ToString() public méthode

Returns a string representation of the values of this Dimension object's height and width fields.
This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.
public ToString ( ) : string
Résultat string

Property Details

height public_oe property

The height dimension. Negative values can be used.
public int height
Résultat int

width public_oe property

The width dimension. Negative values can be used.
public int width
Résultat int