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. Creating a bitmap viewer in Visual C++

Creating a bitmap viewer in Visual C++

Scheduled Pinned Locked Moved C / C++ / MFC
c++graphicstutorialquestion
3 Posts 3 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.
  • K Offline
    K Offline
    kitty5
    wrote on last edited by
    #1

    Does anyone know of a sample MS Visual C++ program that takes raw black and white video data (saved as a binary file) that is transmitted at 3 frames/sec and shows them on the screen at the same rate? if not, is there an article that explains how to do this in Visual C++? thanks in advance. -- modified at 10:10 Wednesday 2nd August, 2006

    Kitty5

    S N 2 Replies Last reply
    0
    • K kitty5

      Does anyone know of a sample MS Visual C++ program that takes raw black and white video data (saved as a binary file) that is transmitted at 3 frames/sec and shows them on the screen at the same rate? if not, is there an article that explains how to do this in Visual C++? thanks in advance. -- modified at 10:10 Wednesday 2nd August, 2006

      Kitty5

      S Offline
      S Offline
      Sarath C
      wrote on last edited by
      #2

      See Displaying a JPG in your MFC Application[^] Seems you can control the frame rate manually by extracting each of your frames from the movie data.

      SaRath.
      _"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"


      My Blog | Understanding State Pattern_

      1 Reply Last reply
      0
      • K kitty5

        Does anyone know of a sample MS Visual C++ program that takes raw black and white video data (saved as a binary file) that is transmitted at 3 frames/sec and shows them on the screen at the same rate? if not, is there an article that explains how to do this in Visual C++? thanks in advance. -- modified at 10:10 Wednesday 2nd August, 2006

        Kitty5

        N Offline
        N Offline
        normanS
        wrote on last edited by
        #3

        If (1) your "black & white video data" is actually "8-bit grey-scale" (which is what one might expect from a video camera), and (2) the image size is fixed (number of pixels horizontal & vertical is known), it could be quite easy.

        Create a window to use to display the images
        Create a bitmap header.
        Set the bitmap parameters (number pixels X & Y, pixel depth, not using pallette, etc)
        Read the binary file into some area in memory
        Set the bitmap header "data" parameter to point to your data
        Use SetDIBitsToDevice to display it in your window.
        Repeat the last 3 steps until stopped

        If the video has unusual attributes (for example, it is 12-bit greyscale from a medical imager, or if it is in columns not rows) you will probably need an intermediate step, to create a bitmap which Windows understands.

        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