Computing.Net > Forums > Programming > how to draw pixel in console c++

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

how to draw pixel in console c++

Reply to Message Icon

Name: Alex G.
Date: September 18, 2002 at 06:54:22 Pacific
OS: Win2000
CPU/Ram: 128
Comment:

Hello everybody, my question is simple for those who knows this. I would like to simply draw a pixel to a screen using c++. But i want to do it in console mode. Any suggestions are appreciated.
Thanks, Alex



Sponsored Link
Ads by Google

Response Number 1
Name: Page
Date: September 18, 2002 at 08:53:11 Pacific
Reply:

I know you have to change video mode.


0

Response Number 2
Name: cup
Date: September 18, 2002 at 09:48:43 Pacific
Reply:

What compiler/version have you got? The calls vary from compiler to compiler and even from one version to the next.


0

Response Number 3
Name: Apple
Date: September 18, 2002 at 18:18:56 Pacific
Reply:

it all depends on the OS, of course. Window winnt, you'll probably be blocked from directly accessing the video memory. Here is some assembly code (somebody please correct me if I screw this up):

; set 320x200x256 vga mode
xor ax,ax
mov al,13h
int 10h

/* back to C
if your OS manages memory with an iron fist
you will probably get an error trying to write to this location.
*/
unsigned char *video = 0xa0000;
video[ y * 320 + x ] = (unsigned char)color;

; set text mode.
xor ax,ax
mov al,6
int 10h



0

Response Number 4
Name: alex g.
Date: September 30, 2002 at 10:33:38 Pacific
Reply:

I am using a gcc compiler. There should be some routines like putPixel() that draw pixel to screen
Alex G.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: how to draw pixel in console c++

how to write trees in VB www.computing.net/answers/programming/how-to-write-trees-in-vb/12216.html

how to find length of image IN C www.computing.net/answers/programming/how-to-find-length-of-image-in-c/3495.html

How to read bit in C www.computing.net/answers/programming/how-to-read-bit-in-c/10123.html