.


:




:

































 

 

 

 


Polygon




:

Polygon (hdc, pt, iCount);

pt POINT, iCount ; , , .

. ALTERNATE (), .. , (1, 3, 5...), .

:

SetPolyFillMode (hdc, iMode);

iMode , WINDING () . :

, , ALTERNATE, , WINDING.

 

(Second Example) case WM _ PAINT... , (Third Example), , , . , , , , , . . 6.4.

...

case WM_PAINT:

hdc = BeginPaint (hwnd, &ps);

Rectangle (hdc, cxClient /8, cyClient /8, 7*cxClient /8, 7*cyClient /8);

MoveToEx (hdc, 0, 0, NULL);

LineTo (hdc, cxClient, cyClient);

MoveToEx (hdc, 0, cyClient, NULL);

LineTo (hdc, cxClient, 0);

Ellipse (hdc, cxClient /8, cyClient /8, 7*cxClient /8, 7*cyClient /8);

RoundRect (hdc, cxClient /4, cyClient /4, 3*cxClient /4, 3*cyClient /4,

cxClient /4, cyClient /4);

EndPaint (hwnd, &ps);

return 0;...

. 6.4. Third Example

, , , , . , .

Windows , , RECT () (regions).

 

, , . rect RECT (), : left, top, right, bottom, .

FillRect (hdc, &rect, hBrush); ( ) .

FrameRect (hdc, &rect, hBrush); , .

InvertRect (hdc, &rect); , , , .. , ( ).

Windows , RECT:

RECT :

SetRect (&rect, xLeft, yTop, xRight, yBottom);

x y:

OffsetRect (&rect, x, y);

:

InflateRect (&rect, x, y);

:

SetRectEmpty (&rect);

:

CopyRect (&DestRect, &SrcRect);

:

IntersectRect (&DestRect, &SrcRect1, &SrcRect2);

:

UnionRect (&DestRect, &SrcRect1, &SrcRect2);

, :

bEmpty = IsRectEmpty (&rect);

, :

bInRect = PtInRect (&rect, point);





:


: 2018-10-14; !; : 230 |


:

:

,
==> ...

958 - | 872 -


© 2015-2024 lektsii.org - -

: 0.014 .