Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[newbie] simple pixel output

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hi!

i'm looking for a function to simply put out a pixel in a regular simple console application, without using the borland library.

example:

drawpixel(R, G, B, x, y);

now i'm a newbie and i don't really want to initialize directx or opengl just to draw a bunch of pixels. so is there a way to draw pixels with a simple function?

thanks! any help appreciated
 
try SetPixel. Before it just get the DC of console. John Fill
1c.bmp


ivfmd@mail.md
 
Check for the API SDK function SetPixel()

COLORREF SetPixel(
HDC hdc,
int X,
int Y,
COLORREF crColor);

You will need a handle to the DC, you obtain it with the GetDC API.

HDC GetDC(
HWND hWnd);

Hope this helps,s-)
Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
thank you for your help. i'd like to point out that i'm a huge newbie in graphics programming :) so i don't know much of the commonly used abbreviations (like "DC", hehe)

if it's not too long, could you post a short program that puts out one pixel at the screen?

example:

#include <iostream.h>

void main()
{
//very short program
}

thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top