Pelles C forum
C language => Pocket PC and Smartphone questions => Topic started by: jasch212 on November 23, 2008, 04:52:29 PM
-
hi,
how can i fill the traingel with a color?
...
// Create a pen, one pixel, bright red.
HPEN hpen = CreatePen(PS_SOLID, 1, RGB(255,0,0));
// Select the pen into the 'Device context' and remember the previous pen.
HPEN hpenSave = SelectObject(ps.hdc, hpen);
// Array of points to 'connect'.
POINT apt[] = {
{ 20,20 },
{ 50,20 },
{ 50,50 },
{ 20,20 }
};
// Draw lines between the points in the 'apt' array.
Polyline(ps.hdc, apt, sizeof(apt) / sizeof(apt[0]));
thanks for answers.
-
Try changing it to something like this.
HBRUSH hBrush = CreateSolidBrush( RGB(255,0,0) );
SelectObject( ps.hdc, hBrush );
POINT apt[] = {
{ 20,20 },
{ 50,20 },
{ 50,50 }
};
Polygon( ps.hdc, apt, 3 );
Hope that works.. ???
-
hi Synfire,
thank you for the fast answer.
it work's very fine! :)
jasch212