Brushes and paint brushes

Source: Internet
Author: User

CBrush Brush, *poldbrush;
Brush.createsolidbrush (hs_bdiagonal, RGB (255, 0, 0));
Poldbrush = PDC->selectobject (&brush);
The intent of the above code is to create a brush, select the device context; Unfortunately, when creating a brush is wrong, the number of parameters is a problem, here and create a brush, when creating a brush to define three parameters: format, width, color; creating a brush simply defines the color.

Create a brush and customize it
Code
CRect rect;
GetClientRect (rect);
PDC->setmapmode (mm_anisotropic);
PDC->setwindowext (rect. Width (), Rect. Height ());
PDC->setviewportext (rect. Width ()/2,-rect. Height ()/2);
PDC->setviewportorg (rect. Width ()/2, Rect. Height ()/2);

Rect. Offsetrect (-rect. Width ()/2,-rect. Height ()/2);

CRect rect1 (CPoint ( -100), CPoint (100, 100));
CRect Rect2 (CPoint ( -100, -100), CPoint (100,-50));

CBrush Brush (Hs_bdiagonal,rgb (255, 0, 0));
CBrush *poldbrush = PDC->selectobject (&brush);

PDC->fillrect (Rect1, &brush);
PDC->fillsolidrect (Rect2, RGB (255, 0, 0));

PDC->selectobject (Poldbrush);

From the above know the definition and selection of painting brush
CBrush Brush (Hs_bdiagonal,rgb (255, 0, 0));
CBrush *poldbrush = PDC->selectobject (&brush);

Brushes and paint brushes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.