PolyDraw - How to fill?
-
Hi... I have created a polydraw.
CPaintDC dc (this);
CRect rect; GetClientRect (&rect); CPen pen (PS\_SOLID, 0, RGB (0, 0, 255)); CPen\* pOldPen = dc.SelectObject (&pen); POINT aPoint3\[7\] = { 10, 10, 100, 150, 150, 150, 10, 100, 500,150,150, 100, 10, 10 }; BYTE types\[7\] = {PT\_MOVETO, PT\_LINETO, PT\_LINETO, PT\_BEZIERTO,PT\_BEZIERTO, PT\_BEZIERTO, PT\_LINETO}; dc.PolyDraw(aPoint3,types,7); dc.SelectObject (pOldPen);
Now i want to fill this polydraw. How can do that? Any help will be appriciated... Thanks...
G.Paulraj
-
Hi... I have created a polydraw.
CPaintDC dc (this);
CRect rect; GetClientRect (&rect); CPen pen (PS\_SOLID, 0, RGB (0, 0, 255)); CPen\* pOldPen = dc.SelectObject (&pen); POINT aPoint3\[7\] = { 10, 10, 100, 150, 150, 150, 10, 100, 500,150,150, 100, 10, 10 }; BYTE types\[7\] = {PT\_MOVETO, PT\_LINETO, PT\_LINETO, PT\_BEZIERTO,PT\_BEZIERTO, PT\_BEZIERTO, PT\_LINETO}; dc.PolyDraw(aPoint3,types,7); dc.SelectObject (pOldPen);
Now i want to fill this polydraw. How can do that? Any help will be appriciated... Thanks...
G.Paulraj
Use
CDC::FloodFill
orCDC::ExtFloodFill
.«_Superman_»
I love work. It gives me something to do between weekends. -
Use
CDC::FloodFill
orCDC::ExtFloodFill
.«_Superman_»
I love work. It gives me something to do between weekends. -
Thanks super man. FloodFill and ExtFloodFill asks HTC. how can get that variable from my code.
G.Paulraj
What do you mean by HTC? You have to specify a point that lies within the bounding lines and the color of the lines. You need to find some way to get this point.
«_Superman_»
I love work. It gives me something to do between weekends. -
What do you mean by HTC? You have to specify a point that lies within the bounding lines and the color of the lines. You need to find some way to get this point.
«_Superman_»
I love work. It gives me something to do between weekends. -
Hi... I am using visual studio 2008. The syntax for FloodFill is FloodFill(HTC htc, int x, int y, COLERREF color); if i use like FloodFill(10,100,RGB(255,255,255));, there will be a syntax error like FlootFill does not take 3 arguments.
G.Paulraj
As mentioned by Superman, you have to use FloodFill from CDC, not the the global function (and it is HDC, not HTC). So, call FloddFill on the paint DC that you already have.
Cédric Moonen Software developer
Charting control [v3.0] OpenGL game tutorial in C++ -
As mentioned by Superman, you have to use FloodFill from CDC, not the the global function (and it is HDC, not HTC). So, call FloddFill on the paint DC that you already have.
Cédric Moonen Software developer
Charting control [v3.0] OpenGL game tutorial in C++ -
Thanks Cédric Moonen. dc.FloodFill(1,1,RGB(255,255,255)); i have called like above. but full screen color has been changed. how to change the color of that particular polydraw area. thanks...
G.Paulraj
The x and y has to be inside the polygon. 1, 1 lies outside in your case. Try 15, 15.
«_Superman_»
I love work. It gives me something to do between weekends.