About Public Structure----内详
2024-07-21 02:17:20
供稿:网友
给你看看它的定义
note: this topic is not complete for rtm, nor has it been handed off to localization.
enter bugs for inaccurate, not incomplete, information using the following raid template.
this is preliminary documentation and subject to change.
send feedback on this topic.
stores the location and size of a rectangular region. for more advanced region functions use a region object.
for a list of all members of this type, see rectangle members.
object
valuetype
rectangle
[visual basic]
<typeconverter(x, convertertypename="system.drawing.rectangleconverter, system.drawing, version=1.0.2411.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a")>
public structure rectangle
[c#]
[typeconverter(x, convertertypename="system.drawing.rectangleconverter, system.drawing, version=1.0.2411.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a")]
public struct rectangle
[c++]
[typeconverter(x, convertertypename="system.drawing.rectangleconverter, system.drawing, version=1.0.2411.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a")]
public __value struct rectangle
[jscript] in jscript, you can use the structures in the .net framework, but you cannot define your own.
remarks
a rectangle is defined by its upper-left corner, width, and height.
requirements
namespace: system.drawing
platforms: windows 98, windows nt 4.0, windows millennium edition, windows 2000
assembly: system.drawing (in system.drawing.dll)
see also
rectangle members | system.drawing namespace | region
syntax based on build 2609.
note: this topic is not complete for rtm, nor has it been handed off to localization.
enter bugs for inaccurate, not incomplete, information using the following raid template.
this is preliminary documentation and subject to change.
send feedback on this topic.
public static (shared) fields
empty stores the location and size of a rectangular region. for more advanced region functions use a region object.
public static (shared) methods
fromltrb creates a new rectangle with the specified location and size.
inflate overloaded. inflates this rectangle by the specified amount.
intersect overloaded. [to be supplied.]
union creates a rectangle that represents the union between a and b.
public static (shared) operators
equality operator tests whether two rectangle objects have equal location and size.
inequality operator tests whether two rectangle objects differ in location or size.
public instance constructors
rectangle constructor overloaded. initializes a new instance of the rectangle class.
public instance properties
bottom gets the y-coordinate of the lower-right corner of the rectangular region defined by this rectangle.
height gets or sets the width of the rectangular region defined by this rectangle.
isempty tests whether this rectangle has a width or a height of 0.
left gets the x-coordinate of the upper-left corner of the rectangular region defined by this rectangle.
location gets or sets the coordinates of the upper-left corner of the rectangular region represented by this rectangle.
right gets the x-coordinate of the lower-right corner of the rectangular region defined by this rectangle.
size gets or sets the size of this rectangle.
top gets the y-coordinate of the upper-left corner of the rectangular region defined by this rectangle.
width gets or sets the width of the rectangular region defined by this rectangle.
x gets or sets the x-coordinate of the upper-left corner of the rectangular region defined by this rectangle.
y gets or sets the y-coordinate of the upper-left corner of the rectangular region defined by this rectangle.
public instance methods
contains overloaded. determines if the specfied point is contained within this rectangle.
equals overridden. tests whether obj is a rectangle with the same location and size of this rectangle.
gethashcode overridden. [to be supplied.]
gettype (inherited from object) gets the type of the object.
inflate overloaded. inflates this rectangle by the specified amount.
intersect overloaded. [to be supplied.]
intersectswith determines if this rectangle intersets with rect.
offset overloaded. adjusts the location of this rectangle by the specified amount.
tostring overridden. converts the attributes of this rectangle to a human readable string.
protected instance methods
finalize (inherited from object) allows an object to attempt to free resources and perform other cleanup operations before the object is reclaimed by the garbage collector (gc). this method may be ignored by the common language runtime; therefore, necessary cleanup operations should be done elsewhere.
in c#, finalizers are expressed using destructor syntax.
memberwiseclone (inherited from object) creates a shallow copy of the current object.
see also
rectangle structure | system.drawing namespace
syntax based on build 2609.