Solved

Line drawing in c++

Posted on 1998-07-22
6
452 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

759 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

20 Experts available now in Live!

Get 1:1 Help Now