Stores a set of four integers that represent the location and size of a rectangle.
Stores a set of four integers that represent the location and size of a rectangle.
Definition rectangle.h:44
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
#define drawing_export_
Define shared library export.
Definition drawing_export.h:13
- Inheritance
- xtd::object → xtd::drawing::rectangle
- Namespace
- xtd::drawing
- Library
- xtd.drawing
- Examples
- The following example draws a rectangle with its upper-left corner at (10, 10). The rectangle has a width of 100 and a height of 50. The second argument passed to the Pen constructor indicates that the pen width is 5 pixels.
When the rectangle is drawn, the pen is centered on the rectangle's boundary. Because the pen width is 5, the sides of the rectangle are drawn 5 pixels wide, such that 1 pixel is drawn on the boundary itself, 2 pixels are drawn on the inside, and 2 pixels are drawn on the outside. For more details on pen alignment, see How to: Set Pen Width and Alignment.
The following illustration shows the resulting rectangle. The dotted lines show where the rectangle would have been drawn if the pen width had been one pixel. The enlarged view of the upper-left corner of the rectangle shows that the thick black lines are centered on those dotted lines.
The example is designed for use with xtd.forms, and it requires xtd::forms::paint_event_args e, which is a parameter of the xtd::forms::control::paint event handler.
e.graphics().draw_rectangle(black_pen, 10, 10, 100, 50);
static xtd::drawing::color from_argb(uint32 argb) noexcept
Creates a xtd::drawing::color class from a 32-bit ARGB value.
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition pen.h:35
- Examples
- border_style.cpp, draw_image.cpp, fill_ellipse.cpp, fill_rectangle.cpp, fill_rounded_rectangle.cpp, form_paint.cpp, graph_control.cpp, graphics.cpp, image_converter.cpp, minesweeper.cpp, owner_button.cpp, painting.cpp, screen.cpp, and user_control.cpp.
|
static rectangle | add (const rectangle &rect, int32 x, int32 y) noexcept |
| Creates and returns an added copy of the specified xtd::drawing::rectangle structure. The copy is added by the specified amount. The original xtd::drawing::rectangle structure remains unmodified.
|
|
static rectangle | add (const rectangle &rect, const drawing::size &sz) noexcept |
| Creates and returns an added copy of the specified xtd::drawing::rectangle structure. The copy is added by the specified amount. The original xtd::drawing::rectangle structure remains unmodified.
|
|
static rectangle | ceiling (const xtd::drawing::rectangle_f &rect) noexcept |
| Converts the specified xtd::drawing::rectangle_f structure to a xtd::drawing::rectangle structure by rounding the xtd::drawing::rectangle_f values to the next higher integer values.
|
|
static rectangle | from_ltrb (int32 left, int32 top, int32 right, int32 bottom) noexcept |
| Creates a xtd::drawing::rectangle structure with the specified edge locations.
|
|
static rectangle | inflate (const rectangle &rect, int32 x, int32 y) noexcept |
| Creates and returns an enlarged copy of the specified xtd::drawing::rectangle structure. The copy is enlarged by the specified amount. The original xtd::drawing::rectangle structure remains unmodified.
|
|
static rectangle | inflate (const rectangle &rect, const drawing::size &sz) noexcept |
| Creates and returns an enlarged copy of the specified xtd::drawing::rectangle structure. The copy is enlarged by the specified amount. The original xtd::drawing::rectangle structure remains unmodified.
|
|
static rectangle | make_intersect (const rectangle &a, const rectangle &b) noexcept |
| Returns a third xtd::drawing::rectangle structure that represents the intersection of two other xtd::drawing::rectangle structures. If there is no intersection, an empty xtd::drawing::rectangle is returned.
|
|
static rectangle | make_union (const rectangle &a, const rectangle &b) noexcept |
| Gets a xtd::drawing::rectangle structure that contains the union of two xtd::drawing::rectangle structures.
|
|
static rectangle | offset (const rectangle &rect, const point &pos) noexcept |
| Creates and returns an offsetted copy of the specified xtd::drawing::rectangle structure. The copy is offsetted by the specified amount. The original xtd::drawing::rectangle structure remains unmodified.
|
|
static rectangle | offset (const rectangle &rect, int32 x, int32 y) noexcept |
| Creates and returns an offsetted copy of the specified xtd::drawing::rectangle structure. The copy is offsetted by the specified amount. The original xtd::drawing::rectangle structure remains unmodified.
|
|
static rectangle | round (const rectangle_f &rect) noexcept |
| Converts the specified xtd::drawing::rectangle_f to a xtd::drawing::rectangle by rounding the xtd::drawing::rectangle_f values to the nearest integer values.
|
|
static rectangle | truncate (const rectangle_f &rect) noexcept |
| Converts the specified xtd::drawing::rectangle_f to a xtd::drawing::rectangle by truncating the xtd::drawing::rectangle_f values.
|
|