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. Suggestions on real-time video display with drawing

Suggestions on real-time video display with drawing

Scheduled Pinned Locked Moved C / C++ / MFC
c++graphicsasp-nethelpquestion
4 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
    Kiran Satish
    wrote on last edited by
    #1

    I wrote a VC++ 6.0 application few years back that we still use. Its basically a Dialog based application with a parent dialog and few child dialogs. Most of the child dialogs have something to do with drawing upon requests from parent dialog. The application itself is multi- threaded. Most of the drawing on some dialogs is done using gdiplus and for a couple using just MFC drawing functions. The only issue is have with this is that it flickers a bit and that flicker rate is different on different systems. We are now thinking of redeveloping the application on VS2010 as support for XP which supports VC++ 6.0 has ended and its getting harder and harder to get PCs with XP on them or even to install XP. I am looking at some best options to choose from to implement in VS2010 for real-time drawing without flicker issues while the core structure will be the same for most part. We will be sticking with dialog based application again as we don't see any real use for SDI or MDI based application in our case. The core of the program is dependent on frames captured from a scientific camera and do some analysis on that frame and do the following Draw the captured frame on a dialog and draw some graphics (squares/lines) on the same frame based on analysis 4 more dialogs (in which one will have plots in it) will draw/refresh with new analysis data for that frame. I am looking at few options like OpenCV (which we already use in other applications) Direct2D (my application doesn't involve any 3D graphics) GdiPlus (not sure if this works better on VS2010) Any suggestions? thanks

    PKNT

    C 1 Reply Last reply
    0
    • K Kiran Satish

      I wrote a VC++ 6.0 application few years back that we still use. Its basically a Dialog based application with a parent dialog and few child dialogs. Most of the child dialogs have something to do with drawing upon requests from parent dialog. The application itself is multi- threaded. Most of the drawing on some dialogs is done using gdiplus and for a couple using just MFC drawing functions. The only issue is have with this is that it flickers a bit and that flicker rate is different on different systems. We are now thinking of redeveloping the application on VS2010 as support for XP which supports VC++ 6.0 has ended and its getting harder and harder to get PCs with XP on them or even to install XP. I am looking at some best options to choose from to implement in VS2010 for real-time drawing without flicker issues while the core structure will be the same for most part. We will be sticking with dialog based application again as we don't see any real use for SDI or MDI based application in our case. The core of the program is dependent on frames captured from a scientific camera and do some analysis on that frame and do the following Draw the captured frame on a dialog and draw some graphics (squares/lines) on the same frame based on analysis 4 more dialogs (in which one will have plots in it) will draw/refresh with new analysis data for that frame. I am looking at few options like OpenCV (which we already use in other applications) Direct2D (my application doesn't involve any 3D graphics) GdiPlus (not sure if this works better on VS2010) Any suggestions? thanks

      PKNT

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      GDI+ works. I suppose flickering is an application problem (it is not a library fault). If you already know OpenCv then using it is an option (as far as I know is rather optimized). I would use Direct2D only if performance really matters, because (I suppose) the learning step could be heavy. On a completely different approach, I would also consider using C# instead of C++ with MFC.

      K 1 Reply Last reply
      0
      • C CPallini

        GDI+ works. I suppose flickering is an application problem (it is not a library fault). If you already know OpenCv then using it is an option (as far as I know is rather optimized). I would use Direct2D only if performance really matters, because (I suppose) the learning step could be heavy. On a completely different approach, I would also consider using C# instead of C++ with MFC.

        K Offline
        K Offline
        Kiran Satish
        wrote on last edited by
        #3

        Thanks for your reply Pallini, I need to interface external hardware in this application that come with C++ api than C#, so I am a bit stuckw ith C++/MFC combo I guess. Basically I get a 512x512 8bit pixel data from a framegrabber which I need to display in realtime and even draw some graphics on this image as needed (mostly squares, dots and lines) based on a colorbar.

        PKNT

        D 1 Reply Last reply
        0
        • K Kiran Satish

          Thanks for your reply Pallini, I need to interface external hardware in this application that come with C++ api than C#, so I am a bit stuckw ith C++/MFC combo I guess. Basically I get a 512x512 8bit pixel data from a framegrabber which I need to display in realtime and even draw some graphics on this image as needed (mostly squares, dots and lines) based on a colorbar.

          PKNT

          D Offline
          D Offline
          DEmberton
          wrote on last edited by
          #4

          You need to double buffer the output. Create a bitmap in memory; copy from your frame to that bitmap, then draw your extra graphics on that bitmap. Then when it's done draw it to the screen in one blit. That's how you get rid of the flicker. Gdi+ will do it fine.

          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