Creating pixel graphics in MFC

This is a discussion on Creating pixel graphics in MFC within the Windows Programming forums, part of the Platform Specific Boards category; I am working on a project that takes a file with a lot of x,y coordinates and a number, for ...

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    12

    Post Creating pixel graphics in MFC

    I am working on a project that takes a file with a lot of x,y coordinates and a number, for how bright/dark a pixel should be, and shows all of these on the screen.

    The result should be a sonar image of the sea floor, and the darker pixel's are in one area, the deeper it is there.

    What I am having trouble with is choosing a method to display all of these points on my screen. How do I draw one pixel at a time (or 5 pixels at a time (in case 1 pixel is to small)), and set the pixels brightness?). The picture is in gray tones.

    I am programming with C++ MfC, in the latest .Net edition of Visual C++

    does anyone have a good suggestion?

    Kristian (Norway)

  2. #2
    Funniest man in this seat minesweeper's Avatar
    Join Date
    Mar 2002
    Posts
    801
    Never used MFC or .NET and this is a real stab in the dark here but what about the WinAPI function:

    SetPixel(hdc, x, y, RGB(0, 0, 0));

    Replace 0, 0, 0 with values between 0 and 255 for levels of red, green and blue respectively. All zeros is black, all 255's is white.

    Don't know about brightness.

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    12

    Thanks

    okay, I'll try this and see what I get.

    Thanks :-)

    Kristian

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MFC support in ATL project
    By Arkanos in forum Windows Programming
    Replies: 2
    Last Post: 01-29-2006, 05:15 PM
  2. Windows Forms and/or MFC [But definately not win32!] questions
    By Robert_Sitter in forum Windows Programming
    Replies: 2
    Last Post: 12-03-2005, 09:28 PM
  3. Beginning MFC (Prosise) Part III - Now What? :: C++
    By kuphryn in forum C++ Programming
    Replies: 5
    Last Post: 03-03-2002, 06:58 PM
  4. MFC:: CString & Serialize ::C++
    By kuphryn in forum C++ Programming
    Replies: 0
    Last Post: 02-22-2002, 03:31 PM
  5. MFC: Multi-threaded DLL Errors & Related Syntax :: C++
    By kuphryn in forum C++ Programming
    Replies: 3
    Last Post: 02-13-2002, 09:02 AM

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