графика в студио
п.с. Или может кто подскажет какую-нибудь другую ф-цию для рисования прямоугольника, чтобы с ее помощью его можно было рисовать его без всяких рамочек?
FillSolidRect
а аргументы? (у меня справки нет в студио
посмотри в класс cdc, там все есть
MFC Library Reference
CDC::FillRectSee Also
CDC Overview | Class Members | Hierarchy Chart | CBrush::CreateHatchBrush | CBrush::CreatePatternBrush | CBrush::CreateSolidBrush | FillRect | GetStockObject | RECT | CBrush | CDC::FillSolidRect
Call this member function to fill a given rectangle using the specified brush.
void FillRect(
LPCRECT lpRect,
CBrush* pBrush
);
Parameters
lpRect
Points to a RECT structure that contains the logical coordinates of the rectangle to be filled. You can also pass a CRect object for this parameter.
pBrush
Identifies the brush used to fill the rectangle.
Remarks
The function fills the complete rectangle, including the left and top borders, but it does not fill the right and bottom borders.
The brush needs to either be created using the CBrush member functions CreateHatchBrush, CreatePatternBrush, and CreateSolidBrush, or retrieved by the GetStockObject Windows function.
When filling the specified rectangle, FillRect does not include the rectangle's right and bottom sides. GDI fills a rectangle up to, but does not include, the right column and bottom row, regardless of the current mapping mode. FillRect compares the values of the top, bottom, left, and right members of the specified rectangle. If bottom is less than or equal to top, or if right is less than or equal to left, the rectangle is not drawn.
FillRect is similar to CDC::FillSolidRect; however, FillRect takes a brush and therefore can be used to fill a rectangle with a solid color, a dithe color, hatched brushes, or a pattern. FillSolidRect uses only solid colors (indicated by a COLORREF parameter). FillRect usually is slower than FillSolidRect.
See Also
CDC Overview | Class Members | Hierarchy Chart | CBrush::CreateHatchBrush | CBrush::CreatePatternBrush | CBrush::CreateSolidBrush | FillRect | GetStockObject | RECT | CBrush | CDC::FillSolidRect
--------------------------------------------------------------------------------
Send feedback on this topic to Microsoft
© Microsoft Corporation. All rights reserved.
MFC Library Reference
CDC::FillSolidRectSee Also
CDC Overview | Class Members | Hierarchy Chart | RECT | CRect | CDC::FillRect
Call this member function to fill the given rectangle with the specified solid color.
void FillSolidRect(
LPCRECT lpRect,
COLORREF clr
);
void FillSolidRect(
int x,
int y,
int cx,
int cy,
COLORREF clr
);
Parameters
lpRect
Specifies the bounding rectangle (in logical units). You can pass either a pointer to a RECT data structure or a CRect object for this parameter.
clr Specifies the color to be used to fill the rectangle.
x
Specifies the logical x-coordinate of the upper-left corner of the rectangle.
y
Specifies the logical y-coordinate of the upper-left corner of the destination rectangle.
cx
Specifies the width of the rectangle.
cy
Specifies the height of the rectangle.
Remarks
FillSolidRect is very similar to CDC::FillRect; however, FillSolidRect uses only solid colors (indicated by the COLORREF parameter while FillRect takes a brush and therefore can be used to fill a rectangle with a solid color, a dithe color, hatched brushes, or a pattern. FillSolidRect usually is faster than FillRect.
Note When you call FillSolidRect, the background color, which was previously set using SetBkColor, is set to the color indicated by clr.
See Also
CDC Overview | Class Members | Hierarchy Chart | RECT | CRect | CDC::FillRect
--------------------------------------------------------------------------------
Send feedback on this topic to Microsoft
© Microsoft Corporation. All rights reserved.
Через эту функцию все получилось!
Осталось только научиться цвета подбирать.......
Оставить комментарий
migel
Заполняю значениями вершины прямоугольника, потом выбираю для него цвет и рисую:hbrush2 = CreateSolidBrush (RGB (128, color, 128;
SelectObject(memdc,hbrush2);
Polygon(memdc, points, 4);
а он рисуется с какой-то дурацкой рамочкой вокруг (цвета того карандаша, который был ранее выбран selectObject'om). Нельзя ли как-нибудь от нее избавиться?!
Может, есть что-нибудь типа бесцветного карандаша?