# Point Estructura

## Definición

Representa un par ordenado de coordenadas enteras x e y que define un punto en un plano bidimensional.Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional plane.

``public value class Point : IEquatable<System::Drawing::Point>``
``public value class Point``
``````[System.ComponentModel.TypeConverter("System.Drawing.PointConverter, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public struct Point : IEquatable<System.Drawing.Point>``````
``public struct Point``
``public struct Point : IEquatable<System.Drawing.Point>``
``````[System.ComponentModel.TypeConverter(typeof(System.Drawing.PointConverter))]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public struct Point``````
``````[<System.ComponentModel.TypeConverter("System.Drawing.PointConverter, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>]
type Point = struct``````
``type Point = struct``
``````[<System.ComponentModel.TypeConverter(typeof(System.Drawing.PointConverter))>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type Point = struct``````
``````Public Structure Point
Implements IEquatable(Of Point)``````
``Public Structure Point``
Herencia
Atributos
Implementaciones

## Ejemplos

En el ejemplo de código siguiente se crean puntos y tamaños mediante varios de los operadores sobrecargados definidos para estos tipos.The following code example creates points and sizes using several of the overloaded operators defined for these types. También se muestra cómo usar la SystemPens clase.It also demonstrates how to use the SystemPens class.

Este ejemplo está diseñado para usarse con Windows Forms.This example is designed to be used with Windows Forms. Cree un formulario que contenga un Button denominado `subtractButton` .Create a form that contains a Button named `subtractButton`. Pegue el código en el formulario y llame al `CreatePointsAndSizes` método desde el método de Paint control de eventos del formulario, pasando `e` como PaintEventArgs .Paste the code into the form and call the `CreatePointsAndSizes` method from the form's Paint event-handling method, passing `e` as PaintEventArgs.

``````void CreatePointsAndSizes( PaintEventArgs^ e )
{
// Create the starting point.
Point startPoint = Point(subtractButton->Size);

// Use the addition operator to get the end point.
Point endPoint = startPoint + System::Drawing::Size( 140, 150 );

// Draw a line between the points.
e->Graphics->DrawLine( SystemPens::Highlight, startPoint, endPoint );

// Convert the starting point to a size and compare it to the
// subtractButton size.
System::Drawing::Size buttonSize = (System::Drawing::Size)startPoint;
if ( buttonSize == subtractButton->Size )
{
e->Graphics->DrawString( "The sizes are equal.", gcnew System::Drawing::Font( this->Font,FontStyle::Italic ), Brushes::Indigo, 10.0F, 65.0F );
}
}
``````
``````private void CreatePointsAndSizes(PaintEventArgs e)
{

// Create the starting point.
Point startPoint = new Point(subtractButton.Size);

// Use the addition operator to get the end point.
Point endPoint = startPoint + new Size(140, 150);

// Draw a line between the points.
e.Graphics.DrawLine(SystemPens.Highlight, startPoint, endPoint);

// Convert the starting point to a size and compare it to the
// subtractButton size.
Size buttonSize = (Size)startPoint;
if (buttonSize == subtractButton.Size)

// If the sizes are equal, tell the user.
{
e.Graphics.DrawString("The sizes are equal.",
new Font(this.Font, FontStyle.Italic),
Brushes.Indigo, 10.0F, 65.0F);
}
}
``````
``````Private Sub CreatePointsAndSizes(ByVal e As PaintEventArgs)

' Create the starting point.
Dim startPoint As New Point(subtractButton.Size)

' Use the addition operator to get the end point.
Dim endPoint As Point = Point.op_Addition(startPoint, _
New Size(140, 150))

' Draw a line between the points.
e.Graphics.DrawLine(SystemPens.Highlight, startPoint, endPoint)

' Convert the starting point to a size and compare it to the
' subtractButton size.
Dim buttonSize As Size = Point.op_Explicit(startPoint)
If (Size.op_Equality(buttonSize, subtractButton.Size)) Then

' If the sizes are equal, tell the user.
e.Graphics.DrawString("The sizes are equal.", _
New Font(Me.Font, FontStyle.Italic), _
Brushes.Indigo, 10.0F, 65.0F)
End If

End Sub
``````

## Comentarios

Para convertir un Point en un PointF , use Implicit .To convert a Point to a PointF, use Implicit.

## Constructores

 Inicializa una nueva instancia de la estructura Point con las coordenadas que especifica un valor entero.Initializes a new instance of the Point struct using coordinates specified by an integer value. Inicializa una nueva instancia de la estructura Point con las coordenadas especificadas.Initializes a new instance of the Point struct with the specified coordinates. Inicializa una nueva instancia de la estructura Point desde Size.Initializes a new instance of the Point struct from a Size.

## Campos

 Representa Point que hace X y los valores Y establecer para poner a cero.Represents a Point that has X and Y values set to zero.