I'm working on a project wich kinda involves making some kind of improved "MsPaint" allowing the user to create a few types of figures, using GDI+ in C#. But since that kind of figures and the way to make them (drawLine, drawLines, drawRectangle) just make lines on a bitmap, I can't completely understand how to make a solid object from, for example, a triangle I made using 'drawlines' method.
For now I just simplified the sourcecode from an Addisson Wesley book "Addison Wesley - Graphics Programming With C Sharp And Gdi+" and I'm using it to learn the basics. Thing is, I'm not even sure if this starting point is the correct to ultimately make the program I wanna make, which as I said before, it should let the user to create "figures" or "objects from figures" and rotate, transform, move them around.
The source code is from this actual site:
http://www.c-sharpcorner.com/Store/Books/0-321-16077-0.asp
I only used Chapter 03 "GDI+ Painter" as I think it could help.
Thank you very much in advanced. I attached the simplified version wich only allows to draw simple lines ellipses and rectangles based on the mentioned GDI+ Painter.
Loading
Adrian ZPosted Sep 6, 2010, 10:54 PM
Thing is, can present this mini-project, on December 2010 or February 2011 and I'm still concerned about learning or at least taking good advantage of what Duncan made since it requires a bit of knowledge about the subject.
Mahesh ChandPosted Sep 2, 2010, 3:13 PM
It that helps, you probably stick with Windows Forms/GDI+. WPF is a learning curve and has lot of new things. IF you do want to learn WPF, check out WPF section of C# Corner.
Felipe RamosPosted Sep 2, 2010, 1:25 PM
Adrian ZPosted Sep 2, 2010, 1:06 PM
Again, thanks Mahesh for the advice since the main thing I was concerned about was to know whether I was on the right track to accomplish what I ultimately wanted for the project or not. Although I didn't mind learning all the stuff from your book since I'm always at the look of learning new things anyway.
Thanks again for all the trouble.
Mahesh ChandPosted Sep 2, 2010, 12:39 PM
Thank you! I am glad you liked my book.
However, If you have a choice, use WPF instead. Drawing support is much much better in WPF than GDI+/Windows Forms. Plus GDI+ has many resource leaks and performance is not good either. Go for WPF.
Adrian ZPosted Sep 2, 2010, 12:24 PM
Thanks again, and I'll probably be back with more questions later haha.
Felipe RamosPosted Sep 2, 2010, 10:50 AM
Adrian ZPosted Sep 2, 2010, 12:29 AM
So I'm not even absolutely sure if using GDI+ and C# is a good starting point to even getting to the final simple product of making a program with the features I mentioned early, actually haha.
EDIT:BTW your book is awesome, although I'm having troubles with this whole "make movable objects thing" I learned a lot with your work.
Mahesh ChandPosted Sep 1, 2010, 11:05 PM
So
1. Triangle class
2. Three public Point properties - P1, P2, P3
3. Draw method
4. Surface or Canvas property (handle of control that you want this triangle to be drawn on such as a Form or a Panel)
I hope this gives you some starting clues.
Good luck!