Click here to Skip to main content
15,860,861 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hello everyone,
i am new to MFC and VC++ programming in general. What i am trying to do right now is write a program that will allow me to draw lines based on a Gupta-Sproull midpoint algorithm. There is Bresenham algorithm but it's different. I believe it does not use distance. So the idea is if i'll left click on a mouse i select a control point on the screen and then can drag anywhere to draw a line. If i right button click then i end control point selection. By using this method i am trying to write something like WAKE which consists of bunch of lines.

My problem is to get started. When i created a project in Visual studio it gives me loads of files for modification. Where should i start and does anyone have a sample code of that algorithm or how and where to use LButtonClick and RButtonClick...

Any help will be appreaciated. The fact that i am new to this sample codes are the best.

thanks
Posted

1 solution

I'd just draw on a plain dialog surface. Create a dialog-based MFC application. Draw your lines and things in the dialog's OnPaint handler. Add button click handlers for the dialog.
 
Share this answer
 


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900