SetPixel()

This is a discussion on SetPixel() within the C++ Programming forums, part of the General Programming Boards category; Hello, im trying to use SetPixel() to create a pixel on my dos console application. I'm not sure how to ...

  1. #1
    deletedforumuser
    Guest

    SetPixel()

    Hello, im trying to use SetPixel() to create a pixel on my dos console application.

    I'm not sure how to use it.

    I tryed:

    SetPixel(hDC, 10,10, RGB(0,0,255));

    It's compiling but it's giving me an error when i open it.

    hDC is not initialized.

    Thank you and i hope you can help me.

    I'm actually not sure how to initialize it.
    Last edited by kevinawad; 08-07-2008 at 08:24 PM.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    ... in your console application? ... Have you read MSDN's page on SetPixel? Have you read MSDN's page on device contexts?

  3. #3
    deletedforumuser
    Guest
    Well, i heard from another website that it's actually usable in a console application.

    I guess ill stick with SetConsoleTextAttribute and make graphics out of colored "spaces".


    Or do you know any other functions to do that?

  4. #4
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    It is useable, but you still have to GetDC(); to get a valid device context.

    Read this.
    Last edited by abachler; 08-08-2008 at 02:23 AM.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SetPixel(), then moving window
    By SgtMuffles in forum Windows Programming
    Replies: 9
    Last Post: 04-22-2005, 08:13 PM
  2. colorref and setpixel
    By bballzone in forum C++ Programming
    Replies: 19
    Last Post: 09-11-2004, 07:09 PM
  3. SetPixel linker error
    By madmardigan53 in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 09-18-2003, 11:31 PM
  4. How to store pixels in memory created with Setpixel(...)
    By Kristian25 in forum Windows Programming
    Replies: 2
    Last Post: 03-11-2003, 06:09 AM
  5. Ask about SetPixel, Lineto and Moveto
    By ooosawaddee3 in forum Windows Programming
    Replies: 2
    Last Post: 11-30-2002, 07:53 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21