![]() |
| | #1 |
| Registered User Join Date: Sep 2007
Posts: 119
| Drawing triangles in C# |
| John_L is offline | |
| | #2 |
| Registered User Join Date: Nov 2007
Posts: 14
| You can use Graphics.DrawPoligon and Graphics.FillPoligon both Method gets an array of Points , if there are 3 points - it'll make a triangles can you send me the code for the gesture based drawing "stuff"? i'm trying for a week or so to make something like that ...but i cant find how to redraw the forms... Thanks |
| Rainbowinblack is offline | |
| | #3 |
| Dr Dipshi++ Join Date: Oct 2006 Location: On me hyperplane
Posts: 1,219
| If theres a built in method it will be easiest to use that. If you want to code your own filled triangle heres some very rough pseudo code for it. Having your own line drawing algo may help too. Code: order points from highest to lowest
get xa decrement for each y iteraion
get xb increment for each y iteration
for(y = highest; y > mid; y--)
{
line(xa, y, xb, y);
xa-= xa_inc;
xb+= xb_inc;
}
repeat for mid to base
Last edited by mike_g; 03-15-2008 at 08:51 AM. |
| mike_g is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Drawing HBITMAP into CWnd, Acquired from "screenshot" | DeusAduro | Windows Programming | 6 | 07-02-2009 03:41 PM |
| Slow drawing code | tjpanda | Windows Programming | 5 | 05-09-2008 05:09 PM |
| How to do double buffing with win32 drawing? | Josh Kasten | Windows Programming | 2 | 03-27-2004 12:02 AM |
| Need help drawing triangles (C) | Belvedeer84 | C Programming | 6 | 10-02-2003 02:00 PM |
| Drawing triangles | TonyLFL | C++ Programming | 7 | 06-02-2002 09:51 AM |