Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: eVC4.0 C++ GDI VC
Dear all I have a problem. I was created a triangle using LineTo and MoveTo methods. Now I am trying to fill that triangle by solid color using FillRgn of CDC class. But WinCE does not support this method. Can anybody tell me the other way to fill that triangle? Here is my code:
for(unsigned short uCntr = 0; uCntr<=tRcsStructure.tSysSetting.ucMaxStationNumbers-1; uCntr++)
	unsigned short x_pos = 45;
	pDC.SelectObject(m_PenColor);pDC.MoveTo(63,(135 + (uCntr * x_pos)));
        pDC.LineTo(96,(135 + (uCntr * x_pos)));
        pDC.MoveTo(63,(117 + (uCntr * x_pos)));
        pDC.LineTo(63,(135 + (uCntr * x_pos)));
        pDC.MoveTo(63,(117 + (uCntr * x_pos)));
        pDC.LineTo(96,(135 + (uCntr * x_pos)));
Currently I am using eVC 4.0.
Posted 2-Jun-12 3:02am
Edited 4-Jun-12 9:18am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I have no experience in WinCE, but I would use CDC::Polygon, which automatically fills the polygon with the current brush. So create a brush with the same color as your solid pen, select it into the DC and then draw a polygon with the three points of your triangle. (Of course you know that a triangle is a special case of a polygon.)
vaibhavj_navdurga at 2-Jun-12 8:44am
Shall we draw a triangle using polygon method?
nv3 at 2-Jun-12 9:29am
vaibhavj_navdurga at 4-Jun-12 1:48am
Thank you for your help. My problem is solved using Polygon method.
vaibhavj_navdurga at 5-Jun-12 3:26am
Is this possible to give the border color to the polygon? If yes, then how? Please help me I am trying the same.
nv3 at 5-Jun-12 3:31am
Of course, your current pen determines the border color.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 424
1 OriginalGriff 375
2 CHill60 230
3 CPallini 220
4 Maciej Los 210
0 Sascha Lefévre 75
1 OriginalGriff 70
2 F-ES Sitecore 55
3 Peter Leow 50
4 Dave Kreskowiak 40

Advertise | Privacy | Mobile
Web04 | 2.8.150327.1 | Last Updated 4 Jun 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100