?
Solved

Line drawing in c++

Posted on 1998-07-22
6
Medium Priority
?
478 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 100 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
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 how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses
Course of the Month9 days, 12 hours left to enroll

762 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