Solved

Line drawing in c++

Posted on 1998-07-22
6
468 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
Independent Software Vendors: 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!

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

705 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