You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -22,30 +21,30 @@ class CPoint : public tagPOINT
22
21
23
22
|Name|Description|
24
23
|----------|-----------------|
25
-
|[CPoint::CPoint](#cpoint)|Constructs a `CPoint`.|
24
+
|[`CPoint::CPoint`](#cpoint)|Constructs a `CPoint`.|
26
25
27
26
### Public Methods
28
27
29
28
|Name|Description|
30
29
|----------|-----------------|
31
-
|[CPoint::Offset](#offset)|Adds values to the `x` and `y` members of the `CPoint`.|
30
+
|[`CPoint::Offset`](#offset)|Adds values to the `x` and `y` members of the `CPoint`.|
32
31
33
32
### Public Operators
34
33
35
34
|Name|Description|
36
35
|----------|-----------------|
37
-
|[CPoint::operator -](#operator_-)|Returns the difference of a `CPoint` and a size, or the negation of a point, or the size difference between two points, or the offset by a negative size.|
38
-
|[CPoint::operator !=](#operator_neq)|Checks for inequality between two points.|
39
-
|[CPoint::operator +](#operator_add)|Returns the sum of a `CPoint` and a size or point, or a `CRect` offset by a size.|
40
-
|[CPoint::operator +=](#operator_add_eq)|Offsets `CPoint` by adding a size or point.|
41
-
|[CPoint::operator -=](#operator_-_eq)|Offsets `CPoint` by subtracting a size or point.|
42
-
|[CPoint::operator ==](#operator_eq_eq)|Checks for equality between two points.|
36
+
|[`CPoint::operator -`](#operator_-)|Returns the difference of a `CPoint` and a `SIZE`, or the negation of a `POINT`, or the `CSize` difference between two `POINT`s, or the offset by a negative `SIZE`.|
37
+
|[`CPoint::operator !=`](#operator_neq)|Checks for inequality between two `POINT`s.|
38
+
|[`CPoint::operator +`](#operator_add)|Returns the sum of a `CPoint` and a `SIZE` or `POINT`, or a `CRect` offset by a `SIZE`.|
39
+
|[`CPoint::operator +=`](#operator_add_eq)|Offsets `CPoint` by adding a `SIZE` or `POINT`.|
40
+
|[`CPoint::operator -=`](#operator_-_eq)|Offsets `CPoint` by subtracting a `SIZE` or `POINT`.|
41
+
|[`CPoint::operator ==`](#operator_eq_eq)|Checks for equality between two `POINT`s.|
43
42
44
43
## Remarks
45
44
46
-
It also includes member functions to manipulate `CPoint` and [POINT](/windows/win32/api/windef/ns-windef-point) structures.
45
+
It also includes member functions to manipulate `CPoint` and [`POINT`](/windows/win32/api/windef/ns-windef-point) structures.
47
46
48
-
A `CPoint` object can be used wherever a `POINT` structure is used. The operators of this class that interact with a "size" accept either [CSize](../../atl-mfc-shared/reference/csize-class.md) objects or [SIZE](/windows/win32/api/windef/ns-windef-size) structures, since the two are interchangeable.
47
+
A `CPoint` object can be used wherever a `POINT` structure is used. The operators of this class that interact with a `SIZE` accept either [`CSize`](../../atl-mfc-shared/reference/csize-class.md) objects or [`SIZE`](/windows/win32/api/windef/ns-windef-size) structures, since the two are interchangeable.
49
48
50
49
> [!NOTE]
51
50
> This class is derived from the `tagPOINT` structure. (The name `tagPOINT` is a less commonly used name for the `POINT` structure.) This means that the data members of the `POINT` structure, `x` and `y`, are accessible data members of `CPoint`.
@@ -61,9 +60,9 @@ A `CPoint` object can be used wherever a `POINT` structure is used. The operator
Specifies the value of the `x` member of `CPoint`.
82
81
83
-
*initY*<br/>
82
+
*`initY`*\
84
83
Specifies the value of the `y` member of `CPoint`.
85
84
86
-
*initPt*<br/>
87
-
[POINT](/windows/win32/api/windef/ns-windef-point) structure or `CPoint` that specifies the values used to initialize `CPoint`.
85
+
*`initPt`*\
86
+
[`POINT`](/windows/win32/api/windef/ns-windef-point) structure or `CPoint` that specifies the values used to initialize `CPoint`.
88
87
89
-
*initSize*<br/>
90
-
[SIZE](/windows/win32/api/windef/ns-windef-size) structure or [CSize](../../atl-mfc-shared/reference/csize-class.md) that specifies the values used to initialize `CPoint`.
88
+
*`initSize`*\
89
+
[`SIZE`](/windows/win32/api/windef/ns-windef-size) structure or [`CSize`](../../atl-mfc-shared/reference/csize-class.md) that specifies the values used to initialize `CPoint`.
91
90
92
-
*dwPoint*<br/>
93
-
Sets the `x` member to the low-order word of *dwPoint* and the `y` member to the high-order word of *dwPoint*.
91
+
*`dwPoint`*\
92
+
Sets the `x` member to the low-order word of *`dwPoint`* and the `y` member to the high-order word of *`dwPoint`*.
94
93
95
94
### Remarks
96
95
@@ -123,7 +122,7 @@ CPoint ptFromDouble(dwSize);
123
122
ASSERT(ptFromDouble == ptMFCHere);
124
123
```
125
124
126
-
## <a name="offset"></a> CPoint::Offset
125
+
## <a name="offset"></a> `CPoint::Offset`
127
126
128
127
Adds values to the `x` and `y` members of the `CPoint`.
Specifies the amount to offset the `x` member of the `CPoint`.
140
139
141
-
*yOffset*<br/>
140
+
*`yOffset`*\
142
141
Specifies the amount to offset the `y` member of the `CPoint`.
143
142
144
-
*point*<br/>
145
-
Specifies the amount ([POINT](/windows/win32/api/windef/ns-windef-point) or `CPoint`) to offset the `CPoint`.
143
+
*`point`*\
144
+
Specifies the amount ([`POINT`](/windows/win32/api/windef/ns-windef-point) or `CPoint`) to offset the `CPoint`.
146
145
147
-
*size*<br/>
148
-
Specifies the amount ([SIZE](/windows/win32/api/windef/ns-windef-size) or [CSize](../../atl-mfc-shared/reference/csize-class.md)) to offset the `CPoint`.
146
+
*`size`*\
147
+
Specifies the amount ([`SIZE`](/windows/win32/api/windef/ns-windef-size) or [`CSize`](../../atl-mfc-shared/reference/csize-class.md)) to offset the `CPoint`.
Contains a [SIZE](/windows/win32/api/windef/ns-windef-size) structure or [CSize](../../atl-mfc-shared/reference/csize-class.md) object.
206
+
*`size`*\
207
+
Contains a [`SIZE`](/windows/win32/api/windef/ns-windef-size) structure or [`CSize`](../../atl-mfc-shared/reference/csize-class.md) object.
209
208
210
-
*point*<br/>
211
-
Contains a [POINT](/windows/win32/api/windef/ns-windef-point) structure or [CPoint](../../atl-mfc-shared/reference/cpoint-class.md) object.
209
+
*`point`*\
210
+
Contains a [`POINT`](/windows/win32/api/windef/ns-windef-point) structure or [`CPoint`](../../atl-mfc-shared/reference/cpoint-class.md) object.
212
211
213
212
### Remarks
214
213
215
-
The second overload adds a point to the `CPoint`.
214
+
The second overload adds a `POINT` to the `CPoint`.
216
215
217
216
In both cases, addition is done by adding the `x` (or `cx`) member of the right-hand operand to the `x` member of the `CPoint` and adding the `y` (or `cy`) member of the right-hand operand to the `y` member of the `CPoint`.
218
217
219
-
For example, adding `CPoint(5, -7)` to a variable which contains `CPoint(30, 40)` changes the variable to `CPoint(35, 33)`.
218
+
For example, adding `CPoint(5, -7)` to a variable that contains `CPoint(30, 40)` changes the variable to `CPoint(35, 33)`.
Contains a [SIZE](/windows/win32/api/windef/ns-windef-size) structure or [CSize](../../atl-mfc-shared/reference/csize-class.md) object.
235
+
*`size`*\
236
+
Contains a [`SIZE`](/windows/win32/api/windef/ns-windef-size) structure or [`CSize`](../../atl-mfc-shared/reference/csize-class.md) object.
238
237
239
-
*point*<br/>
240
-
Contains a [POINT](/windows/win32/api/windef/ns-windef-point) structure or [CPoint](../../atl-mfc-shared/reference/cpoint-class.md) object.
238
+
*`point`*\
239
+
Contains a [`POINT`](/windows/win32/api/windef/ns-windef-point) structure or [`CPoint`](../../atl-mfc-shared/reference/cpoint-class.md) object.
241
240
242
241
### Remarks
243
242
244
-
The second overload subtracts a point from the `CPoint`.
243
+
The second overload subtracts a `POINT` from the `CPoint`.
245
244
246
245
In both cases, subtraction is done by subtracting the `x` (or `cx`) member of the right-hand operand from the `x` member of the `CPoint` and subtracting the `y` (or `cy`) member of the right-hand operand from the `y` member of the `CPoint`.
247
246
248
-
For example, subtracting `CPoint(5, -7)` from a variable which contains `CPoint(30, 40)` changes the variable to `CPoint(25, 47)`.
247
+
For example, subtracting `CPoint(5, -7)` from a variable that contains `CPoint(30, 40)` changes the variable to `CPoint(25, 47)`.
Contains a [SIZE](/windows/win32/api/windef/ns-windef-size) structure or [CSize](../../atl-mfc-shared/reference/csize-class.md) object.
265
+
*`size`*\
266
+
Contains a [`SIZE`](/windows/win32/api/windef/ns-windef-size) structure or [`CSize`](../../atl-mfc-shared/reference/csize-class.md) object.
268
267
269
-
*point*<br/>
270
-
Contains a [POINT](/windows/win32/api/windef/ns-windef-point) structure or [CPoint](../../atl-mfc-shared/reference/cpoint-class.md) object.
268
+
*`point`*\
269
+
Contains a [`POINT`](/windows/win32/api/windef/ns-windef-point) structure or [`CPoint`](../../atl-mfc-shared/reference/cpoint-class.md) object.
271
270
272
-
*lpRect*<br/>
273
-
Contains a pointer to a [RECT](/windows/win32/api/windef/ns-windef-rect) structure or [CRect](../../atl-mfc-shared/reference/crect-class.md) object.
271
+
*`lpRect`*\
272
+
Contains a pointer to a [`RECT`](/windows/win32/api/windef/ns-windef-rect) structure or [`CRect`](../../atl-mfc-shared/reference/crect-class.md) object.
274
273
275
274
### Return Value
276
275
277
-
A `CPoint` that is offset by a size, a `CPoint` that is offset by a point, or a `CRect` offset by a point.
276
+
A `CPoint` that is offset by a `SIZE`, a `CPoint` that is offset by a `POINT`, or a `CRect` offset by a `POINT`.
278
277
279
278
### Remarks
280
279
281
280
For example, using one of the first two overloads to offset the point `CPoint(25, -19)` by a point `CPoint(15, 5)` or size `CSize(15, 5)` returns the value `CPoint(40, -14)`.
282
281
283
-
Adding a rectangle to a point returns the rectangle after being offset by the `x` and `y` values specified in the point. For example, using the last overload to offset a rectangle `CRect(125, 219, 325, 419)` by a point `CPoint(25, -19)` returns `CRect(150, 200, 350, 400)`.
282
+
Adding a `CRect` to a `POINT` returns the `CRect` after being offset by the `x` and `y` values specified in the `POINT`. For example, using the last overload to offset a rectangle `CRect(125, 219, 325, 419)` by a point `CPoint(25, -19)` returns `CRect(150, 200, 350, 400)`.
A [POINT](/windows/win32/api/windef/ns-windef-point) structure or [CPoint](../../atl-mfc-shared/reference/cpoint-class.md) object.
301
+
*`point`*\
302
+
A [`POINT`](/windows/win32/api/windef/ns-windef-point) structure or [`CPoint`](../../atl-mfc-shared/reference/cpoint-class.md) object.
304
303
305
-
*size*<br/>
306
-
A [SIZE](/windows/win32/api/windef/ns-windef-size) structure or [CSize](../../atl-mfc-shared/reference/csize-class.md) object.
304
+
*`size`*\
305
+
A [`SIZE`](/windows/win32/api/windef/ns-windef-size) structure or [`CSize`](../../atl-mfc-shared/reference/csize-class.md) object.
307
306
308
-
*lpRect*<br/>
309
-
A pointer to a [RECT](/windows/win32/api/windef/ns-windef-rect) structure or a [CRect](../../atl-mfc-shared/reference/crect-class.md) object.
307
+
*`lpRect`*\
308
+
A pointer to a [`RECT`](/windows/win32/api/windef/ns-windef-rect) structure or a [`CRect`](../../atl-mfc-shared/reference/crect-class.md) object.
310
309
311
310
### Return Value
312
311
313
-
A `CSize` that is the difference between two points, a `CPoint` that is offset by the negation of a size, a `CRect` that is offset by the negation of a point, or a `CPoint` that is the negation of a point.
312
+
A `CSize` that is the difference between two `POINT`s, a `CPoint` that is offset by the negation of a `SIZE`, a `CRect` that is offset by the negation of a `POINT`, or a `CPoint` that is the negation of a `POINT`.
314
313
315
314
### Remarks
316
315
@@ -320,18 +319,18 @@ For example, using the first overload to find the difference between two points
320
319
321
320
Subtracting a `CSize` from `CPoint` does the same calculation as above but returns a `CPoint` object, not a `CSize` object. For example, using the second overload to find the difference between the point `CPoint(25, -19)` and the size `CSize(15, 5)` returns `CPoint(10, -24)`.
322
321
323
-
Subtracting a rectangle from a point returns the rectangle offset by the negatives of the `x` and `y` values specified in the point. For example, using the last overload to offset the rectangle `CRect(125, 200, 325, 400)` by the point `CPoint(25, -19)` returns `CRect(100, 219, 300, 419)`.
322
+
Subtracting a rectangle from a `POINT` returns the rectangle offset by the negatives of the `x` and `y` values specified in the `POINT`. For example, using the last overload to offset the rectangle `CRect(125, 200, 325, 400)` by the point `CPoint(25, -19)` returns `CRect(100, 219, 300, 419)`.
324
323
325
-
Use the unary operator to negate a point. For example, using the unary operator with the point `CPoint(25, -19)` returns `CPoint(-25, 19)`.
324
+
Use the unary operator to negate a `POINT`. For example, using the unary operator with the point `CPoint(25, -19)` returns `CPoint(-25, 19)`.
0 commit comments