Point.Add(Point, Size) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
public:
static System::Drawing::Point Add(System::Drawing::Point pt, System::Drawing::Size sz);
public static System.Drawing.Point Add(System.Drawing.Point pt, System.Drawing.Size sz);
static member Add : System.Drawing.Point * System.Drawing.Size -> System.Drawing.Point
Public Shared Function Add (pt As Point, sz As Size) As Point
Parameters
Returns
The 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. Handle the form's Paint event and call the AddPoint
method from the Paint event-handling method, passing e
as PaintEventArgs.
private void AddPoint(PaintEventArgs e)
{
Point point1 = new Point(10, 10);
Point point2 = Point.Add(point1, new Size(250,0));
e.Graphics.DrawLine(Pens.Red, point1, point2);
}
Private Sub AddPoint(ByVal e As PaintEventArgs)
Dim point1 As New Point(10, 10)
Dim point2 As Point = Point.Add(point1, New Size(250, 0))
e.Graphics.DrawLine(Pens.Red, point1, point2)
End Sub
Remarks
The Add adds the Width and Height of the specified Size to the X and Y values of the specified point.
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET