CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2011
    Posts
    29

    How do I overlay an image on the Picture Control which is used to play the live video

    Hi,

    I m trying to overlay an image on a live video produced using Microsoft Kinect. The IDE used is Visual Studio Professional 2010. The code is developed in vc++.I m able to play the live video using picture control. I tried to overlay the image in WM_PAINT using BitBlt and StretchBlt functions.But on using it, the image is present on the parent Dialog box on top of which the Video is played in picture control.

    How do I overlay an image on the Picture Control which is used to play the live video?

  2. #2
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: How do I overlay an image on the Picture Control which is used to play the live v

    The picture control is pretty basis and doesn't provide you with much feedback of what's playing.

    The only way you can achieve this with a picture control is by using a transparrent layered window. Depending on your videocard and version of windows this could have a severe impact on the framerate / CPU usage of your PC.
    Have a look at the WS_EX_LAYERED style on MSDN. This is used in combination with UpdateLayeredWindow().


    The alternative/better solution is to handle the frame updating yourself and paint the overlay each time explicitely. There are API's in the multimedia section to handle playing videostreams.

  3. #3
    Join Date
    Apr 2011
    Posts
    29

    Re: How do I overlay an image on the Picture Control which is used to play the live v

    Thankx for the response....

    HRESULT hr = m_pDrawColor->Initialize(GetDlgItem(m_hWnd, IDC_VideoViewer), m_pD2DFactory, cColorWidth, cColorHeight, cColorWidth * sizeof(long));

    IDC_VideoViewer is a picture control created in rc file.

    This is how I initialise my Picture control to view the video....I m using CreateDialogParamW function to create a dialog box and in the DlgProc i m initialising to view the frame.I m using D2D1 to render the video.

    Could you pls help me out to know wer to use the WS_EX_LAYERED so that I can pass the Id of picture control and over the image on the live video running...

  4. #4
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: How do I overlay an image on the Picture Control which is used to play the live v

    Try static control's parent window (or dialog). But afraid, if your video runs overlay mode, you cannot lay anything over it.
    Best regards,
    Igor

  5. #5
    Join Date
    Apr 2011
    Posts
    29

    Re: How do I overlay an image on the Picture Control which is used to play the live v

    I tried placing another picture control over the one that is playing the video and loading the image on to the second one.But the problem faced here is that image is flickering at a random manner and it gets vanished after few minutes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured