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. Simultaneous Previewing & Video Capture using DirectShow [modified]

Simultaneous Previewing & Video Capture using DirectShow [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
comgraphicshelpquestion
22 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.
  • J Justin Tay

    You still aren't answering my questions. And I still don't know what the problem is nor what you are trying to do. The article presents a very unconventional way of capturing an image off a filter graph, and requires that a VMR video renderer be used. Depending on what you need, and what you can assume of the system it will be installed in, this may or may not be a good technique to use. Ok how about this, you copy the OnTimer handler and put it in your handler.

    DWORD dwSize;
    dwSize=this->m_VMRCap.GrabFrame();
    if(dwSize>0)
    {
    BYTE *pImage;
    this->m_VMRCap.GetFrame (&pImage);
    this->m_ctrlCaptureIMG .ShowImage (pImage);
    }

    A Offline
    A Offline
    aloha1812
    wrote on last edited by
    #21

    void CDXCaptureDlg::OnCapImage() { DWORD dwSize; dwSize=this->m_VMRCap.GrabFrame (); if(dwSize>0) { BYTE *pImage; this->m_VMRCap.GetFrame (&pImage); this->m_ctrlCaptureIMG .ShowImage (pImage); } } this code is used to capture a video, but I want to capture a bitmap aloha -- modified at 2:51 Tuesday 20th June, 2006

    J 1 Reply Last reply
    0
    • A aloha1812

      void CDXCaptureDlg::OnCapImage() { DWORD dwSize; dwSize=this->m_VMRCap.GrabFrame (); if(dwSize>0) { BYTE *pImage; this->m_VMRCap.GetFrame (&pImage); this->m_ctrlCaptureIMG .ShowImage (pImage); } } this code is used to capture a video, but I want to capture a bitmap aloha -- modified at 2:51 Tuesday 20th June, 2006

      J Offline
      J Offline
      Justin Tay
      wrote on last edited by
      #22

      The code does not capture a video and I don't even know how you came to that conclusion. I would suggest you read the code and understand what is going on first. The code gets the current bitmap in the VMR renderer and ensures that it is in RGB24. pImage will end up as an array of RGBTRIPLEs that makes up the image. Note that he discards the bitmap header in GrabFrame() all you have is just the RGB24 data. If you want to create a HBITMAP with this, look up CreateDIBitmap on msdn.

      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