Thread: SetPixel()

  1. #1


    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 07:24 PM.

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

  3. #3
    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
    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 01:23 AM.

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, 07:13 PM
  2. colorref and setpixel
    By bballzone in forum C++ Programming
    Replies: 19
    Last Post: 09-11-2004, 06:09 PM
  3. SetPixel linker error
    By madmardigan53 in forum A Brief History of
    Replies: 1
    Last Post: 09-18-2003, 10: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