Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. display grayscale image in visual c++ 6.0

display grayscale image in visual c++ 6.0

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gurucplusplus
    wrote on last edited by
    #1

    I am new to window enviroment and I would like to know how I can display grayscale image using visual c++ 6.0? snowcone

    L H 2 Replies Last reply
    0
    • G gurucplusplus

      I am new to window enviroment and I would like to know how I can display grayscale image using visual c++ 6.0? snowcone

      L Offline
      L Offline
      lafleon
      wrote on last edited by
      #2

      Hello, You need to use Win32 along GDI functions like this: CreateWindow() GetDC() SelectObject() GetStockObject() SetStretchBltMode() SetPixel() StretchBlt() BitBlt() … DeleteDC() DeleteObject() etc. Regards,

      G 1 Reply Last reply
      0
      • L lafleon

        Hello, You need to use Win32 along GDI functions like this: CreateWindow() GetDC() SelectObject() GetStockObject() SetStretchBltMode() SetPixel() StretchBlt() BitBlt() … DeleteDC() DeleteObject() etc. Regards,

        G Offline
        G Offline
        gurucplusplus
        wrote on last edited by
        #3

        Since I am too new to window visualC++, I am not quite following your flow here. Can you give me code example that I can compile and run in visualc++ to load an grayscale image and display it on window frame? Thanks.

        C 1 Reply Last reply
        0
        • G gurucplusplus

          Since I am too new to window visualC++, I am not quite following your flow here. Can you give me code example that I can compile and run in visualc++ to load an grayscale image and display it on window frame? Thanks.

          C Offline
          C Offline
          cp9876
          wrote on last edited by
          #4

          Try searching for bitmaps on codeproject.

          Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

          1 Reply Last reply
          0
          • G gurucplusplus

            I am new to window enviroment and I would like to know how I can display grayscale image using visual c++ 6.0? snowcone

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            of course you can use of SetPixelRGB with two loops for height and width but its not good idea better use of BitBlt and see last parameter of BitBlt on the MSDN


            WhiteSky


            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups