fillsolidrect(FillRect和FillSolidRect[亲测有效])

发布时间:2025-12-10 20:03:12 浏览次数:2

FillRect和FillSolidRect[亲测有效]-

FillRect()和FillSolidRect()[亲测有效]voidFillRect(LPCRECTlpRect,CBrush*pBrush);ParameterslpRectPointertoaRECTstructurethatcontainsthelogicalcoordinatesoftherectangletofill.YoucanalsopassaCRectobject…

void FillRect( LPCRECT lpRect, CBrush* pBrush );

是否还在为Ide开发工具频繁失效而烦恼,来吧关注以下公众号获取最新激活方式。亲测可用!

为防止网络爬虫,请关注公众号回复”口令”

激活idea 激活CLion DataGrip DataSpell dotCover dotMemory dotTrace GoLand PhpStorm PyCharm ReSharper ReShaC++ Rider RubyMine WebStorm 全家桶 刷新

【正版授权,激活自己账号】:Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】:官方授权 正版激活 自己使用,支持Jetbrains家族下所有IDE…

Parameters

lpRect Pointer to a RECT structure that contains the logical coordinates of the rectangle to fill. You can also pass a CRect object for this parameter. pBrush Identifies the brush used to fill the rectangle.
void CXXX::OnPaint() {CPaintDC dc(this);CRect rct;        CBrush m_brBack;         m_brBack.CreateSolidBrush(RGB(255,0,0));GetClientRect(&rct);dc.FillRect(&rct,&m_brBack);}
void FillSolidRect( LPCRECT lpRect, COLORREF clr );void FillSolidRect( int x, int y, int cx, int cy, COLORREF clr );

Parameters

lpRect The bounding rectangle in logical units. You can pass a pointer to a RECT data structure or a CRect object for this parameter. clr The color to use to fill the rectangle. x The logical x-coordinate of the upper-left corner of the rectangle. y The logical y-coordinate of the upper-left corner of the destination rectangle. cx The width of the rectangle. cy The height of the rectangle.
void CXXX::OnPaint() {        CRect  m_rtThis;        GetClientRect(&rct);CPaintDC dc(this);dc.SetBkMode(TRANSPARENT);dc.FillSolidRect(&m_rtThis, RGB(255,0,0));}


总之:FillRect()要用画刷进行刷区域,FillSolidRect()直接指定颜色刷区域就可以

转载于:https://www.cnblogs.com/wuguoqiang/p/5955505.html

需要做网站?需要网络推广?欢迎咨询客户经理 13272073477