Solved

Line drawing in c++

Posted on 1998-07-22
6
461 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

 
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
C++ Language error 28 245
Least Squares Curve Fitting 4 96
C++ :Change value from  DisableCMD registry 4 66
Where are the c++ header files to use in Eclipse? 4 24
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

856 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