Solved

Line drawing in c++

Posted on 1998-07-22
6
454 Views
Last Modified: 2010-08-05
I am using Microsoft Visual C++ 5.0 and i am creating a windows console application (dos-based application) and i was wondering how i would draw lines in my program?  
0
Comment
Question by:karthy
6 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1168323
you can use the line drawing characters.  Take a look at a DOS ASCII character set chart.  There are characters that appear like single and double lines that go horizontally or verically  (there are also corner and other line joining characters.)

You can output these characters just like any others.

Note you cannot draw diagonal lines this way.  For real graphics, you need to switch to a windows GUI program.
0
 

Expert Comment

by:Roni070998
ID: 1168324
Why should you do it? It is really worthwhile to create an MFC project and do it using views.
A good place to start is "Jeff Prosise - Programming windows 95 with MFC", Chapter 2

"Give a man a fish, he'll have a dinner; Give him a fishing line, he'll have dinner every day".
Roni
0
 

Expert Comment

by:Roni070998
ID: 1168325
Why should you do it? It is really worthwhile to create an MFC project and do it using views.
A good place to start is "Jeff Prosise - Programming windows 95 with MFC", Chapter 2

"Give a man a fish, he'll have a dinner; Give him a fishing line, he'll have dinner every day".
Roni
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 8

Expert Comment

by:trestan
ID: 1168326
nietod already gave you a good answer. You should give a response.
0
 
LVL 1

Expert Comment

by:ElmerFud
ID: 1168327
You could create a new window inside your console application.

I'm not sure what you want to do with it, but you could bring up a seperate window and draw lines on it, circles on it.  Very simple code.  If you're interested, I could post some.
0
 

Accepted Solution

by:
fritzinger earned 50 total points
ID: 1168328
If you want some pretty nice graphics for the console, you can try downloading a good
dos svga library, and using that, BUT that will increase the size of your executable
dramatically.

nietod supplied a good answer if you want simple graphics, and a quick way to do them
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now