Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional plane.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:43
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.hpp:54
- Inheritance
- xtd::object → xtd::drawing::point
- Namespace
- xtd::drawing
- Library
- xtd.drawing
- Examples
void create_points_and_sizes(paint_event_args&
e) {
point start_point = subtract_button.size();
point end_point = start_point +
size(140, 150);
size button_size(start_point);
if (button_size == subtract_button.size()) {
}
}
static xtd::drawing::solid_brush indigo()
A system-defined brush object.
Defines a particular format for text, including font face, size, and style attributes....
Definition font.hpp:45
bool italic() const noexcept
Gets a value that indicates whether this xtd::drawing::font is italic.
static xtd::drawing::pen highlight()
Gets a pen that is the color of the highlight.
font_style
Specifies style information applied to text. This enumeration has a flags attribute that allows a bit...
Definition font_style.hpp:17
Stores an ordered pair of integers, which specify a height and width.
Definition size.hpp:31
- Examples
- animation.cpp, application_settings_without_cmake_setting_commands.cpp, buttons.cpp, circular_form.cpp, colored_forms.cpp, docked_panels.cpp, draw_point.cpp, emplace.cpp, fill_ellipse.cpp, fill_rectangle.cpp, fill_rounded_rectangle.cpp, form_paint.cpp, graph_control.cpp, graphics.cpp, labels_and_unicode_text.cpp, lcd_label3.cpp, minesweeper.cpp, point.cpp, screenshot.cpp, tutorial_button.cpp, user_control.cpp, and wiggly.cpp.
|
| object ()=default |
| Create a new instance of the ultimate base class object.
|
|
virtual type_object | get_type () const noexcept |
| Gets the type of the current instance.
|
|
template<class object_t > |
xtd::uptr< object_t > | memberwise_clone () const |
| Creates a shallow copy of the current object.
|
|
virtual bool | equals (const point &) const noexcept=0 |
| Indicates whether the current object is equal to another object of the same type.
|
|
template<class object_a_t , class object_b_t > |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are considered equal.
|
|
template<class object_a_t , class object_b_t > |
static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are the same instance.
|
|
◆ point() [1/4]
xtd::drawing::point::point |
( |
| ) |
|
|
defaultnoexcept |
◆ point() [2/4]
xtd::drawing::point::point |
( |
int32 |
dw | ) |
|
|
explicitnoexcept |
Initializes a new instance of the xtd::drawing::point class using coordinates specified by an integer value.
- Parameters
-
- Examples
- The following code example demonstrates how to use the point and size. size constructors and the xtd::drawing::content_alignment enumeration. To run this example, paste this code into a Windows Form (xtd::forms) that contains a label named label1, and call the initialize_label1 method in the form's constructor.
void initialize_label1() {
label1.border_style = border_style::fixed_single;
label1.location(
point(0x280028));
label1.text_align = content_alignment::bottom_right;
label1.text = "Bottom Right Alignment";
}
point() noexcept=default
Initializes a new instance of the xtd::drawing::point class.
◆ point() [3/4]
Initializes a new instance of the xtd::drawing::point class with the specified coordinates.
- Parameters
-
x | The horizontal position of the point. |
y | The vertical position of the point. |
- Examples
- The following code example demonstrates how to use the Equality operator and how to construct a point from a size or two integers. It also demonstrates how to use the x and y properties. This example is designed to be used with Windows Forms (xtd.forms). Paste the code into a form that contains a button named button1, and associate the button1_click method with the button's click event.
void button1_click(
object& sender,
const event_args&
e) {
graphics form_graphics = create_graphics();
if (point1 == point2) {
form_graphics.
draw_string(
string::format(
"point1.x: {}, point2.x: {}, point1.y: {}, point2.y {}", point1.x(), point2.x(), point1.y(), point2.y()),
font(),
brushes::black,
point_f(10, 70));
}
}
static xtd::drawing::solid_brush black()
A system-defined brush object.
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics.hpp:67
void draw_string(const xtd::string &s, const xtd::drawing::font &font, const xtd::drawing::brush &brush, const xtd::drawing::rectangle_f &layout_rectangle)
Draws the specified text string at the specified rectangle with the specified xtd::drawing::brush and...
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.hpp:18
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition point_f.hpp:35
◆ point() [4/4]
xtd::drawing::point::point |
( |
const size & |
sz | ) |
|
|
explicitnoexcept |
Initializes a new instance of the xtd::drawing::point class from a xtd::drawing::size.
- Parameters
-
sz | A size that specifies the coordinates for the new point. |
- Examples
- The following code example demonstrates how to use the Equality operator and how to construct a point from a size or two integers. It also demonstrates how to use the x and y properties. This example is designed to be used with Windows Forms (xtd.forms). Paste the code into a form that contains a button named button1, and associate the button1_click method with the button's click event.
void button1_click(
object& sender,
const event_args&
e) {
graphics form_graphics = create_graphics();
if (point1 == point2) {
form_graphics.
draw_string(
string::format(
"point1.x: {}, point2.x: {}, point1.y: {}, point2.y {}", point1.x(), point2.x(), point1.y(), point2.y()),
font(),
brushes::black,
point_f(10, 70));
}
}
◆ is_empty()
bool xtd::drawing::point::is_empty |
( |
| ) |
const |
|
noexcept |
◆ equals() [1/2]
bool xtd::drawing::point::equals |
( |
const xtd::object & |
obj | ) |
const |
|
overridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
- Parameters
-
obj | The object to compare with the current object. |
- Returns
true
if the specified object is equal to the current object. otherwise, false
.
Reimplemented from xtd::object.
◆ equals() [2/2]
bool xtd::drawing::point::equals |
( |
const point & |
other | ) |
const |
|
overridenoexcept |
Determines whether the specified object is equal to the current object.
- Parameters
-
other | The object to compare with the current object. |
- Returns
true
if the specified object is equal to the current object. otherwise, false
.
◆ get_hash_code()
xtd::size xtd::drawing::point::get_hash_code |
( |
| ) |
const |
|
overridevirtualnoexcept |
Serves as a hash function for a particular type.
- Returns
- A hash code for the current object.
Reimplemented from xtd::object.
◆ offset() [1/2]
void xtd::drawing::point::offset |
( |
int32 |
dx, |
|
|
int32 |
dy |
|
) |
| |
|
noexcept |
Translates this xtd::drawing::point by the specified amount.
- Parameters
-
dx | The amount to offset the x-coordinate. |
dy | The amount to offset the y-coordinate. |
◆ offset() [2/2]
void xtd::drawing::point::offset |
( |
const point & |
p | ) |
|
|
noexcept |
◆ to_string()
◆ truncate()
static point xtd::drawing::point::truncate |
( |
const point_f & |
value | ) |
|
|
staticnoexcept |
◆ add() [1/2]
static point xtd::drawing::point::add |
( |
const point & |
pt, |
|
|
const size & |
sz |
|
) |
| |
|
staticnoexcept |
Adds the specified xtd::drawing::size to the specified xtd::drawing::point.
- Parameters
-
- Returns
- The xtd::drawing::point that is the result of the addition operation.
- Examples
- The following example shows how to use the add method. To run this example, paste it into a Windows Form (xtd::forms. Handle the form's xtd::forms::control::paint event and call the add_point method from the paint event-handling method, passing e as paint_event_args.
void add_point(paint_event_args&
e) {
e.graphics().draw_line(
pens::red, point1, point2);
}
static point add(const point &pt, const size &sz) noexcept
Adds the specified xtd::drawing::size to the specified xtd::drawing::point.
◆ add() [2/2]
static point xtd::drawing::point::add |
( |
const point & |
pt1, |
|
|
const point & |
pt2 |
|
) |
| |
|
staticnoexcept |
◆ ceiling()
static point xtd::drawing::point::ceiling |
( |
const point_f & |
value | ) |
|
|
staticnoexcept |
◆ round()
static point xtd::drawing::point::round |
( |
const point_f & |
value | ) |
|
|
staticnoexcept |
◆ subtract() [1/2]
static point xtd::drawing::point::subtract |
( |
const point & |
pt, |
|
|
const size & |
sz |
|
) |
| |
|
staticnoexcept |
◆ subtract() [2/2]
static point xtd::drawing::point::subtract |
( |
const point & |
pt1, |
|
|
const point & |
pt2 |
|
) |
| |
|
staticnoexcept |
◆ operator+() [1/2]
point xtd::drawing::point::operator+ |
( |
const size & |
sz | ) |
const |
|
noexcept |
◆ operator+() [2/2]
point xtd::drawing::point::operator+ |
( |
const point & |
pt | ) |
const |
|
noexcept |
◆ operator+=() [1/2]
point & xtd::drawing::point::operator+= |
( |
const size & |
sz | ) |
|
|
noexcept |
◆ operator+=() [2/2]
point & xtd::drawing::point::operator+= |
( |
const point & |
pt | ) |
|
|
noexcept |
◆ operator-() [1/2]
point xtd::drawing::point::operator- |
( |
const size & |
sz | ) |
const |
|
noexcept |
◆ operator-() [2/2]
point xtd::drawing::point::operator- |
( |
const point & |
pt | ) |
const |
|
noexcept |
◆ operator-=() [1/2]
point & xtd::drawing::point::operator-= |
( |
const size & |
sz | ) |
|
|
noexcept |
◆ operator-=() [2/2]
point & xtd::drawing::point::operator-= |
( |
const point & |
pt | ) |
|
|
noexcept |
◆ empty
const point xtd::drawing::point::empty |
|
static |
int32 xtd::drawing::point::x |
Gets or sets the x-coordinate of this xtd::drawing::point.
- Parameters
-
- Examples
- The following code example demonstrates how to use the Equality operator and how to construct a point from a size or two integers. It also demonstrates how to use the x and y properties. This example is designed to be used with Windows Forms (xtd.forms). Paste the code into a form that contains a button named button1, and associate the button1_click method with the button's click event.
void button1_click(
object& sender,
const event_args&
e) {
graphics form_graphics = create_graphics();
if (point1 == point2) {
form_graphics.
draw_string(
string::format(
"point1.x: {}, point2.x: {}, point1.y: {}, point2.y {}", point1.x(), point2.x(), point1.y(), point2.y()),
font(),
brushes::black,
point_f(10, 70));
}
}
- Examples
- animation.cpp, and minesweeper.cpp.
int32 xtd::drawing::point::y |
Gets or sets the y-coordinate of this xtd::drawing::point.
- Parameters
-
- Examples
- The following code example demonstrates how to use the Equality operator and how to construct a point from a size or two integers. It also demonstrates how to use the x and y properties. This example is designed to be used with Windows Forms (xtd.forms). Paste the code into a form that contains a button named button1, and associate the button1_click method with the button's click event.
void button1_Click(
object& sender,
const event_args&
e) {
graphics form_graphics = create_graphics();
if (point1 == point2) {
form_graphics.
draw_string(
string::format(
"point1.x: {}, point2.x: {}, point1.y: {}, point2.y {}", point1.x(), point2.x(), point1.y(), point2.y()),
font(),
brushes::black,
point_f(10, 70));
}
}
- Examples
- animation.cpp, minesweeper.cpp, and screen.cpp.
The documentation for this struct was generated from the following file: