Introduction: This is a detailed page for drawing rounded rectangle in wince Graphic programming. It introduces the knowledge, skills, and experience related to C/C ++, and some C/C ++ source code.
Implementation Code:
// Draw a rounded rectangle
CDC * PDC = new cclientdc (this );
Cbrush brushgreen (RGB (0,255, 0 ));
Cbrush * poldbrush = PDC-> SelectObject (& brushgreen );
Cpen penblack;
Penblack. createpen (ps_solid, 3, RGB (255, 0 ));
Cpen * poldpen = PDC-> SelectObject (& penblack );
Crect rect;
Getclientrect (rect );
Rect. deflaterect (60, 60 );
PDC-> roundrect (rect, cpoint (20, 20 ));
PDC-> SelectObject (poldbrush );
PDC-> SelectObject (poldpen );
Brushgreen. deleteobject ();
Penblack. deleteobject ();
Actual results:
The test environment is a Windows Mobile 6 Classic Chinese simulator.
Reference: An Introduction to Windows CE embedded advanced programming and its examples prepared by Mr. Wang Bing