powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / C++ [игнор отключен] [закрыт для гостей] / нужна срочная помощь в понимании
6 сообщений из 6, страница 1 из 1
нужна срочная помощь в понимании
    #34479048
STORMY STEEL
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
что конкретно нужно написать в

BOOL CreatePolygonRgn( LPPOINT lpPoints, int nCount, int nMode);

в скобочках
...
Рейтинг: 0 / 0
нужна срочная помощь в понимании
    #34479058
Фотография FasterHarder
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Код: plaintext
I started in 1983, in 2007 i still on a case!

авторMFC Library Reference
CRgn::CreatePolygonRgn
Creates a polygonal region.


BOOL CreatePolygonRgn(
LPPOINT lpPoints,
int nCount,
int nMode
);
Parameters
lpPoints
Points to an array of POINT structures or an array of CPoint objects. Each structure specifies the x-coordinate and y-coordinate of one vertex of the polygon. The POINT structure has the following form:
Copy Code
typedef struct tagPOINT {
int x;
int y;
} POINT;
nCount
Specifies the number of POINT structures or CPoint objects in the array pointed to by lpPoints.
nMode
Specifies the filling mode for the region. This parameter may be either ALTERNATE or WINDING.
Return Value
Nonzero if the operation succeeded; otherwise 0.

Remarks
The system closes the polygon automatically, if necessary, by drawing a line from the last vertex to the first. The resulting region is stored in the CRgn object.

The size of a region is limited to 32,767 by 32,767 logical units or 64K of memory, whichever is smaller.

When the polygon-filling mode is ALTERNATE, the system fills the area between odd-numbered and even-numbered polygon sides on each scan line. That is, the system fills the area between the first and second side, between the third and fourth side, and so on.

When the polygon-filling mode is WINDING, the system uses the direction in which a figure was drawn to determine whether to fill an area. Each line segment in a polygon is drawn in either a clockwise or a counterclockwise direction. Whenever an imaginary line drawn from an enclosed area to the outside of a figure passes through a clockwise line segment, a count is incremented. When the line passes through a counterclockwise line segment, the count is decremented. The area is filled if the count is nonzero when the line reaches the outside of the figure.

When an application has finished using a region created with the CreatePolygonRgn function, it should select the region out of the device context and use the DeleteObject function to remove it.

Example
Copy Code
CRgn rgnA, rgnB;

CPoint ptVertex[5];

ptVertex[0].x = 180;
ptVertex[0].y = 80;
ptVertex[1].x = 100;
ptVertex[1].y = 160;
ptVertex[2].x = 120;
ptVertex[2].y = 260;
ptVertex[3].x = 240;
ptVertex[3].y = 260;
ptVertex[4].x = 260;
ptVertex[4].y = 160;

VERIFY(rgnA.CreatePolygonRgn( ptVertex, 5, ALTERNATE));

CRect rectRgnBox;
int nRgnBoxResult = rgnA.GetRgnBox( &rectRgnBox );
ASSERT( nRgnBoxResult != ERROR || nRgnBoxResult != NULLREGION );

CBrush brA, brB;
VERIFY(brA.CreateSolidBrush( RGB(255, 0, 0) )); // rgnA Red
VERIFY(pDC->FrameRgn( &rgnA, &brA, 2, 2 ));
VERIFY(brB.CreateSolidBrush( RGB(0, 0, 255) )); // Blue
rectRgnBox.InflateRect(3,3);
pDC->FrameRect( &rectRgnBox, &brB );
...
Рейтинг: 0 / 0
нужна срочная помощь в понимании
    #34479111
STORMY STEEL
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
спасибо за помощь

напиши, пожалуйста ссылку, где эту книгу можно скачать
...
Рейтинг: 0 / 0
нужна срочная помощь в понимании
    #34479272
Фотография FasterHarder
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Код: plaintext
I started in 1983, in 2007 i still on a case!

авторнапиши, пожалуйста ссылку, где эту книгу можно скачать


книгу говоришь, а я незнаю, если такая книга, а инфа взята со горячо мною любимого
http://%5D%7C>]http://]|> msdn.com
...
Рейтинг: 0 / 0
нужна срочная помощь в понимании
    #34479274
Фотография FasterHarder
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Код: plaintext
I started in 1983, in 2007 i still on a case!

прошу прощения за некорректную ссылку, вот так :
http://msdn.com
...
Рейтинг: 0 / 0
нужна срочная помощь в понимании
    #34479474
STORMY STEEL
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Большое спасибо
))))
...
Рейтинг: 0 / 0
6 сообщений из 6, страница 1 из 1
Форумы / C++ [игнор отключен] [закрыт для гостей] / нужна срочная помощь в понимании
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]