Home » C++ Programming

Any way to show camera stream and draw something on this video stream?

Here I want to write an interesting application.

In my program, I will capture the video generated by camera and show it to user in real time style. That's mean user will get what camera get.

Then I will draw some computer graphics on this video stream, like 2D text, 3D model etc.

Any good way to do this? How can I show the camera video stream and how can I draw something on it?


Water Lin


5 Answers Found


Answer 1

You can write  your customized directshow camera  application.You can start your DShow Camera application  from this sample
Normally in display controller hardware has the support for multiple layers(ex:Base-->Overlay1-->Overlay2-->Cursor)
Normally if your device display driver has the support for DirectDraw,then there will be support for hardware rendering in those above surfaces.
For DShow camera renderer you can use DDRAW renderer which will use one surface.(Say Overlay1).
Using DDRAW apis you can create another surface on top of video  stream(Say Overlay 2).On this surface you can display your custom 2D text.
For checking the DDRAW support on your hardware you can run the sample applications which is found on the WM 6.5 DTK install directory.
C:\Program Files\Windows Mobile 6.5.3 DTK\Samples\PocketPC\CPP\win32\directx\DDraw\

Answer 3

You can write  your customized directshow camera  application.You can start your DShow Camera application  from this sample
Normally in display controller hardware has the support for multiple layers(ex:Base-->Overlay1-->Overlay2-->Cursor)
Normally if your device display driver has the support for DirectDraw,then there will be support for hardware rendering in those above surfaces.
For DShow camera renderer you can use DDRAW renderer which will use one surface.(Say Overlay1).
Using DDRAW apis you can create another surface on top of video  stream(Say Overlay 2).On this surface you can display your custom 2D text.
For checking the DDRAW support on your hardware you can run the sample applications which is found on the WM 6.5 DTK install directory.
C:\Program Files\Windows Mobile 6.5.3 DTK\Samples\PocketPC\CPP\win32\directx\DDraw\

Thanks for you detail instructions.

Currently I know how to use DDraw for drawing overlay.

I am still wondering how to draw  the camera view on my screen? I want to build a full screen application and I will draw the camera view on this application. Something like camere capture  view on Windows Mobile system.

If I want to do this, do I need to capture camera picture one by one and draw them on my application? Or is there any other API to do it for me?


Water Lin


Answer 4

you have to use DirectShow Framework to show  the Camera view (preview) on  your screen. Sample applications are available in the Windows SDK as well as the Windows Mobile AKU or Windows CE platform builder.

I have given a sample directshow framework from windows CE 6.0.





Answer 5


I'm write  an application  for Samsung Omnia2 similar to your program. I need capture video  in real  time and overlay shapes and text.

can you help me?





Dear All :

Recent, I have writen the code about capture the live view from IP Camera and broadcast to outside by using asp.net

The code like the following





















































protectedvoid Button1_Click(object sender, EventArgs e)


req = (


req.Credentials =

newNetworkCredential(login, password);

resp = req.GetResponse();

stream = resp.GetResponseStream();


while (read != 0)



// check total read


if (total > bufSize - readSize)


total = 0;



// read next portion from stream


if ((read = stream.Read(buffer, total, readSize)) == 0)



total += read;

bytesReceived += read;




Bitmap bmp = (Bitmap)Bitmap.FromStream(newMemoryStream(buffer, 0, total));


MemoryStream result = newMemoryStream();




bmp =



Response.ContentType =



byte[] getBuffer = result.ToArray();




It's work and show the live view picture on the web. However, they cannot refresh picture interval. As I want to create threading to refresh the live view picture automatically.  Can anyone provide some example to me. So I have using threading method to refresh the picture on server side ?


Michael Yip






I am using dshownet(first time) and C#. I have got a sample to take the web cam input and display it on a form. I now need to draw a rectangle on top of the video stream using the mouse. (the intent is to track what is inside the box from there onwards).

I heard that there is something called VMR. So I went to the dshownet samples and went through them. I didnt find any samples that use the mouse to overlay a shape on the video stream. Someone on here suggested to use colorkey. Another person said to use GDI+ and mouse handling. I tried to compile the DXLogo sample but got this error :

Error   1       Cannot create an instance of the abstract class or interface 'System.Drawing.Image'     C:\Documents and Settings\TLNA\Desktop\Final Year Project\Libraries\DirectShow library 2\DirectShowSamples-2010-February\Samples\Capture\DxLogo\Capture.cs      128     32      DxLogo-2008


for the code section:

if (fileName.Length > 0)
          m_Bitmap = new Image(fileName); // error happened here

          Rectangle r = new Rectangle(0, 0, m_Bitmap.Width, m_Bitmap.Height);
          m_bmdLogo = m_Bitmap.LockBits(r, ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);


I know that I must go through the IMVRMixerBitmap9 Interface. But I really dont know where to start. Should I read the Directshow API docs.

btw I also have the book Programming Microsoft Directshow for digital video and television. I started reading that book and stopped after a few pages since the code is mainly in C++. Should I continue to read this is book ? How can I accomplish the certain mentioned tasks in C# ?

Any suggestions as how to draw on the video. Some useful links(tutorials) would be helpful.

Many Thanks

I'm the webmaster for a TV station and for years we have been streaming WMV files on our website, both live feeds and archived videos.
Since the recent introduction of IE8, we have had literally thousands of our viewers email or call us to complain that they are unable to video the videos that they once were able to.
The common theme being that they now have IE8 as their browser.

Since there seems to be no fix for this issue, we have resorted to suggesting an alternative browser, such as Firefox which currently has no issues for our streams.

The users can hear audio but see no video and quite understandably this is unacceptable to both our users and ourselves.

There are no issues with the embedded player or associated code as the videos work in all previous versions of IE and most if not all, other browsers.

Does IE8 require perhaps additional or alternative code to properly display video?

Does anyone have a solution for this problem?
Sony HXR-MC1P POV Camera Review-1080i HD Video Camera Recorder

With the images above, do you have any idea about the selling point for Sony compact HXR-MC1P? Yes, it is sports shooting. It is easy to shoot videos from the participant's point of view. This compact POV camera is also easy for recording the wildlife, animal and small insects. It is an ideal 1080i compact HD camera for taking records. With the recording profiles, you can shoot videos for 3 to 6 hours.
Sony HXR-MC1P is PAL version, and HXR-MC1 the NTSC version. The Sony HXR-MC1P digital HD video camera recorder takes video signal in PAL colour and CCIR standards 1080/50i specification, while the Sony HXR-MC1/AAC POV camera takes video signal in NTSC color and EIA standards 1080/60i specification.
Specifications of Sony HXR-MC1 compact Point of View camera:
Splash-proof camera system for tough outdoor conditions
Lens: Carl Zeiss Vario-Tessar
Optical zoom: 10x
Image file format: Exif
Video Recording:
Video formats:
High definition: AVCHD videos with .mts file extension in MPEG 4 AVC/H.264 video codec.
Standard definition: MPEG 2 Program Stream (MPEG 2-PS) videos with .mpg file extension in MPEG 2 video codec.
Audio: Dolby Digital 2ch
Recording profiles:
FH mode: Approx. 16Mbps (1920x1080), HQ mode: Approx. 9Mbps (1440x1080)
SP mode: Approx. 7Mbps (1440x1080), LP mode: Approx. 5Mbps (1440x1080)
HQ mode: Approx. 9Mbps (720x576), SP mode: Approx. 6Mbps (720x576)
LP mode: Approx. 3Mbps (720x576)

You can easily transfer videos from camera to computer hard drive. If you face any problem playing the AVCHD videos from Sony HXR-MC1P POV camera, you can use Aunsoft MTS/M2TS Converter for Mac as the Mac Sony HXR-MC1P AVCHD converter. The converter can help you deinterlace 1080i video footage, transcode AVCHD video to H.264 MP4, MOV or other formats for your computer, editing software and even website. You can easily play Sony HXR-MC1P videos on QuickTime Player or VLC, edit HD videos on Adobe Premiere, Final Cut Pro (FCP), Avid Media Composer, and so on.
The conversion process of Sony MTS to Avid is quite similar to the process for Sony MTS to Final Cut Pro. You can have a look and play around Sony MTS videos.

Have recorded a lot of videos and pictures on iPhone 4 with the camera and wanna transfer camera recorded videos and camera pictures from iPhone 4 to Mac ?

As versatile iPhone to Mac Transfer software, 3herosoft iPhone to Computer Transfer for Mac transfer music, movie, photo, ePub, pdf, audiobook, Voice memo, Camera roll (iOS 4 above), ringtone, Podcast and TV Show from iPhone to Mac without using iTunes and transfer files from iPhone to iTunes directly. You can Free download it now and enjoy.

NOTE:If you are Windows user , you can download this iPad/iPhone/iPod to Windows Transfer to help.

Guide: Transfer camera recorded videos and camera pictures from iPhone 4 to Mac?

The guide as follows will show you how to transfer camera recorded videos and camera pictures etc camara roll files from iPhone to Mac with 3herosoft iPhone to Computer Transfer for Mac. Follow the guide step by step, you will learn the iPhone 4 camara roll files transferring in fast way!

Install and launch the software
Free download the software and install it on your Mac. Then launch this iPhone to Mac Transfer software and connect your iPhone 4 to Mac. All information about iPhone, such as type, capacity, version, serial number and format, will be shown on the main interface. And in the left panel all items stored iPhone 4 library consisting of music, movie, books, ringtones, voice memos, photo, camera and other playlist.

How to transfer camera recorded videos and camera pictures from iPhone 4 to Mac


Transfer Camera roll files From iPhone 4 to Mac
1)Open the "Camera" library and all camera roll files are displayed in file browser.
2)Find the camera roll you want to transfer and check them.
3)Click the "Export->Export to local" on the top-menu, or directly click the "Export checked files to local” button, and an "Open" dialog box pops up, select a destination for saving camera roll files and press "Save" button to start to transfer iPhone camera roll to Mac.

How to transfer camera recorded videos and camera pictures from iPhone 4 to Mac

How to transfer camera recorded videos and camera pictures from iPhone 4 to Mac

More transfer skills: .

Transfer MusicTransfer VideosTransfer PhotosTransfer iBooks(ePub bpoks) PDFTransfer Voice memosTransfer RingtonesTransfer Camera Roll filesFree DownloadiPhone to Computer Transfer For Mac .   
You can know more features about it by referring here .
For Windows user , please use this iPad/iPhone/iPod to Windows Transfer to help.

Tanbee Flip Video Converteris a full-featured tool for Flip video camera owners, which can convert Flip videos (MP4 format) to common videos including WMV, AVI, 3GP, FLV, RM, MOV, SWF, etc. Convert FLip videos shot by your UltraHD, the MinoHD, and the SlideHD camera to various formats with this Flip Video Converter.

How to convert flip video camera video files using this Flip Video Converter? The article will show you a step-by-step tutorial to complete the conversion task. First, download Tanbee Flip Video Converter , install and run the program.

Step 1: Add Flip video files into Tanbee Flip Video Converter
Click "Add" button or Add files from main menu to browse your computer hard drive and select the flip videos you want to convert.

Step 2: Choose the optimized output format
Choose the file, click "Profile" drop-down button to choose the format you need, there are a variety of video and audio format for output, then choose destination folder for saving output files.

Step 3: Start conversion
After all the settings, you just need to click "Start" button to start the conversion.


I am using Microsoft Media Foundation in MFC to get video from IP camera (D-Link 920). I tried Source resolver (IMFSourceResolver) with both synchronous and asynchronous methods, also implementing credential manager to pass user name and password to the IP camera. 

When I run my application by entering URL of the IP cam it does some handshakings with the Cam but after some time exits with the following error: "hr = 0x8007007a - The data area passed to a system call is too small."

I am just unable to figure this out.

I'm working on Vista with Windows SDK 7.1


Play Sony Cyber-shot DSC-TX7 Camera MTS Videos on iPhone 4

I just bought Sony Cyber-shot DSC-TX7 camera and like to play with the new AVCHD recording, which is the spotlight comparing to previous Cyber-shot cameras. It is good to know that PMB Portable is built into the camera for easy transferring and downloading videos to hard drive. But I could not play the AVCHD video on iPhone 4.

The AVCHD video from Sony TX7 is in .mts format, which is not recognized by iTunes, let alone to iPhone 4. I googled for solutions to sync AVCHD videos to iPhone 4, and found Aunsoft MTS/M2TS Converter for Mac the perfect Mac Sony TX7 to iPhone 4 converter. Besides converting AVCHD to iPhone 4 MP4, it also downscales the video resolution from 1920x1080 to iPhone 4 compatible 720p.

If you have similar problems for playing camera HD videos on iPhone 4, just follow the steps below to convert AVCHD videos on Mac Snow Leopard and enjoy videos on iPhone 4.

Step 1. Load Sony TX7 HD videos to Aunsoft MTS/M2TS Converter for Mac.
After transferring Sony TX7 AVCHD video to computer hard drive, just run Aunsoft MTS/M2TS Converter for Mac as the best Mac Sony TX7 to iPhone 4 converter, and click the "Add" button to load HD 1080i AVCHD videos.

Step 2. Choose iPhone 4 MP4 format.
Click the "Format" option and choose iPhone > iPhone 4 H.264 720P(*.mp4) for converting 1080i Sony MTS to 720p MP4 for iPhone 4 with H.264 as video codec.

Step 3. Convert 1080i MTS to iPhone 4 MP4.
Click the convert button and the Mac Sony to iPhone 4 converter starts transcoding 1080i MTS to iPhone 4 MP4.

Wait until the conversion is finished, and it is easy to sync Sony videos to iPhone 4 via iTunes then. Aunsoft MTS/M2TS Converter for Mac helps you convert Sony AVCHD videos to iPhone 4, and AVCHD videos from Canon camcorder, Panasonic camcorder to iPhone 4.
Overview of Adobe Premiere and Flip Camcorder: Adobe Premiere Pro is one professional, real-time,timeline based video editing software application. Flip cameras store their video in a high-definition MP4 format. However, you will likely not be able to edit the video by importing it into Premiere Pro without converting it. The best solution to make Flip Slidehd/Ultra/Mino camcorder mp4 videos edit on Adobe Premiere Pro version 1.0, 1.5, 2.0, CS3, CS4 and CS5. 

Best solution - Flip to Adobe Premiere Converter Flip to Adobe Premiere Converter is a magical app for Premiere Pro fans to import and edit flip video in Premiere Pro AVI, MOV, MPEG (MPE,MPG), AIFF, MP3, WAV, WMA, etc. Flip Video to Adobe Premiere Converter easily convert flip camera videos to Premiere Pro with no quality loss. Under the help of the Converter, you can import the output video and edit it in Premiere Pro with ease, no matter which Adobe Premiere Pro version you possess. Furthermore, it can also support you to import Flip video to Windows Movie Maker/WMM

Guide to import/edit Flip videos in Premiere Pro with several simple steps.

Part One: Convert Flip Video to Adobe Premiere Pro Format AVI, MOV, MPEG etc. Step 1: Load files
After download and run Flip to Adobe Premiere Converter, Press "Add File" to import flip .mp4 video to the program. 

Flip video to Adobe Premiere & Premiere Edit Flip Camere files.

Step 2: Select the output format and its destination
Select the output format in the drop-down list of "Profile", like DV-AVI. Specify its destination when click the "Browse" button.

Flip video to Adobe Premiere & Premiere Edit Flip Camere files.

Step 3: Click "Convert" button to start converting flip camera video to target format. 
After successfully convert Flip to Premiere Pro supporting formats, you can import the video to Adobe Premiere.

Part Two: How to import output video clips and other files into Adobe Premiere Pro? Adobe Premiere accepts you to import a single video clip, multiple clips, or an entire folder of clips. You can also import a variety of audio and still image files, including sequences of images and layered Photoshop files. 

Select File > Import from the main menu.

Tip1: To import a single file: Locate and select the file, then click Open.
Tip2: To import multiple files: Hold down the Control key to select multiple files, then click Open.
Tip3: To import a folder of files: Locate and select the folder you want to import, then click Folder. A new bin is created in the Project window, containing the contents of the folder.
Tip4: You can also import files and folders by dragging them from "Finder" into the Project panel.

1.The pixel size of your clip cannot exceed 4000 x 4000 pixels.
2.If your imported clip appears distorted or stretched, its pixel aspect ratio may be set incorrectly.

Well Done. Enjoy Flip video editing in Adobe Premiere Pro with Flip to Adobe Premiere Converter.

Related: Flip camera review: The best flip camera after Flip Ultra, Flip Mino, Flip Ultra HD and Flip Mino HD.



I like to capture video with this camera


it has a rca output wich should be converted to a bytearray to send over a serial interface like ZigBee and back to show it on a eg laptop.

I've got two questions:

1. How can I convert a rca signal to a bytearray?
2. How can I convert a bytearray back to a rca signal?

Rca is the yellow plug for your video!

Any help would be appreciated!




     I have a OmniVision camera (used mainly in cell phones), which is connected to a USB cable. After opening explorer, I connect the USB cable to my Laptop ( running Windows XP Professional SP3), I get "USB Video Device" show up in the folders. When I click on this folder, I get live stream of images which are displayed in Explorer. Does anyone know what tools if any I would need, or how I go about interfacing to this USB device via the VC++ application? What I would like to do is to create a VC++ application which brings these live images into the application view window for real time image processing. Currently I am using VC++ 6.0 enterprise edition, but would gladly upgrade if necessary. Thanks so much for your help.



MOD is a video file format used to record on JVC(MOD and TOD), Canon(MOD Only), Panasonic(MOD Only) Camcorder. With Apple iPad is release, watching your camera MOD, TOD files on iPad sounds like a tempting idea, however, if you want to play MOD TOD files on Apple iPad, you must convert MOD TOD to iPad compatible video format, Tanbee iPad Video Converter would help you fast convert these MOD TOD files to iPad video formats with high video quality. Tanbee iPad Video Converter is the ideal solution for playing movies, videos and music of various formats on your iPad.

Convert MOD to iPad MP4 in 3 steps

Step 1: Load the MOD TOD file
Click "Add" button to load the MOD TOD file you want to convert.

Step 2: Choose an output format
In the profile drop down list, choose a target format for the output file. You can choose from iPad HD/H.264/MPEG-4 videos, MP3/M4A/WAV audios.

Step 3: Start the conversion
Just click the bit "Start" button to start the Camera MOD to iPad video conversion. And the conversion will be completed in a few minutes. Tanbee iPad Video Converter makers the MOD to iPad conversion so simple. Click to see what else the converter also features: Tanbee iPad Video Converter .

HI all,
i have a problem
i want to overlay an image on camera stream 
i use directshow sample cameracapture  
i want to set the camera fullscreen and overlay some image on it
but  i can't catch camera video buffer? 
on pc, seems to use directdraw can do it??
i want to develop on windows mobile 5.0
any sample code can reference???
thanks to help!!!


This tutorial is going to tell you that. Why can't import Kodak Camera Video to Windows Movie maker directly. And how to solve this problem. No matter which Kodak camera you have used, this will be fit for. Support Kodak Easyshare Camera series, Kodak Zi6, Zi8, Kodak Playsport Playtouch and so on. hope this can help you.

More Info:http://www.kodak-video-converter.com/edit-kodak-camera-video-with-wmm.html

As we all know that Kodak video cameras' output is .MOV format and the Kodak PLAYTOUCH camera's output format is .MP4. Sometimes we want to import Kodak camera video files into Windows Movie Maker for editing. Add some music to our video, add some special effect onto the video, or something else with Windows Movie Maker. But When putting Kodak camera files to Windows Movie Maker, something worry happened. Why?

Why can't import Kodak camera video to Windows Movie maker?

"I have bought a Kodak Playtouch video camera, and when I drag the video files to Windows Movie Maker, there is just a sound but no picture. Does my video files broken?"

"I record from My Kodak EasyShare M590, when I upload the video files onto my computer and import the .MOV files to Windows Movie maker, but it didn't work. What happened?"

So why? First, we should Know more about Microsoft Windows Movie Maker. These is a Windows Movie Maker official website that tell you which video format is Windows Movie Maker Support. If you are interested in, Click: And right now we know windows Movie Maker support format is WMV/AVI/MPEG1/MPG. Therefore convert Kodak camera video to WMV or AVI format. Your video can be put into Windows Movie Maker.

How to Convert Video from Kodak camera to WMV/AVI and upload Kodak video to Windows Movie Maker?

Step one: Maker sure you have installed a Video Converter and copy your Video files to computer.
Download Kodak Video Converter, and click .exe install Kodak Video to WMM converter on your computer.

Step two: Add you Kodak Camera video to Converter:
Click "add Video" button and select Which Kodak Video you want to edit with Windows Movie Maker.

Step three: Select output WMV format
Click "profile" --> HD Video or Common Video --> WMV Video.

Step four: do some base editing
You can trim a time length duration by clipping, cut off unwanted parts by cropping, brightness by add effects, adjust video saturation, contrast.

Step five: Start conversion
Click "Start" button to convert Kodak Video to Windows Movie Maker format.

Kodak Camera to windows movie maker,video from Kodak Camera to WMM

Does the new Video files lose any quality?
Our Kodak Video converter won't lose any quality, when you convert Kodak camera video files to Windows Movie Maker format.

How to choose Widescreen(16:9) or non-Widescreen (4:3)?
On the right of "profile", there is a setting button, Click it to set Resolution.
If your Kodak Video camera is greater than 720P, and is 16:9 widescreen, you can choose HD Video set (1280X720, 1920x1080) Resolution. Otherwise Chose Common Video or HD Video set (1440x1080, 720x640, 640x480) Resolution for 4:3.

Why Choose Kodak Video Converter?
Kodak Video Converter, not only help you to convert Kodak camera video to Windows Movie Maker but other popular format such as MP4 for apple product iPod, iPhone, iPad. And when you finish editing Kodak Video with Windows Movie Maker. Kodak Video to WMM converter also can help you to Convert Kodak camera files to FLV to upload Kodak video to YouTube. And so on.


The Flip Video is a camcorder for digital video created by Pure Digital Technologies, a company bought by Cisco Systems in March 2009. Currently made and sold variants include the UltraHD, the MinoHD, and the SlideHD.

Tanbee Flip Converter for Mac, extremely intuitive Flip camera video converter. This Mac Flip Converter offers the most robust function to convert Flip videos to AVI, MOV, FLV, 3GP and other popular video formats on Mac OS X. It also natively supports converting AVI, MPG, WMV, DV, MOV, etc and more. With Tanbee Flip Converter for Mac, you can efficiently extract MP3, M4A, etc. audio from Flip video.

In addition to convert Flip video file, Tanbee Flip Converter for Mac enables you to optimize your Flip video files, such as set video brightness, contrast, saturation effect, and the editing function, trimming video, cropping video and adjusting video effect.

Free Download: http://dl.tanbee.com/macosx/flip-converter-mac.zip



I am developing a application in which I want to capture video using Camera and display in the webpage lively. [This is one to many]

I am able to capture video using webcame in windows application. I want to know How can I display this video lively in the webpage.

Thanks in advance.


What is URL should i give to stream the video from an ip camera in a WPF media Element ?

Is there any other way on how to stream the video from an IP camera ?


Thanks in adv

Vamsee Inala


Hello experts,


I have been trying to put together a simple video capture application that will take video from a USB camera setup on "CAM1:" and display it to the screen on a Windows CE device. So far, I this is my thought process:

I need to build a filter graph and then run it. The filter graph will consist of a filter for capturing video from the camera and a filter for rendering the video to the screen. For the capture filter, I use CLSID_VideoCapture and change no settings so that it will use "CAM1:" by default. For the rendering filter, I am lost. I noticed the IVideoWindow interface and thought that I could use that but I'm not sure how.


Any help is very much appreciated.





Here is what I have figured out so far:

bool CVideoCapture::Start(HWND hWnd)
    bool success = false;
    HRESULT hResult;

    // Create the Filter Graph Manager.
    hResult = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC, IID_IGraphBuilder, (void**)&_pGraph);   
    if (SUCCEEDED(hResult))
        // Initialize Capture Graph Builder
        hResult = CoCreateInstance(CLSID_CaptureGraphBuilder, NULL, CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2, (void**)&_pBuilder);
        if (SUCCEEDED(hResult))
            // Connect the GraphBuilder to the CaptureGraphBuilder

            // Initialize the Media Control
            _pGraph->QueryInterface(IID_IMediaControl, (void **)&_pMediaControl);

            // Initialize the Video Window
            _pGraph->QueryInterface(IID_IVideoWindow, (void **)&_pVidWin);

            // Add the Video Capture filter. By default, it will use "CAM1:".
            hResult = CoCreateInstance(CLSID_VideoCapture, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void**)&_pVideoCaptureFilter);
            _pGraph->AddFilter(_pVideoCaptureFilter, TEXT("Video Capture Filter"));

            // Render the stream in preview mode
            hResult = _pBuilder->RenderStream(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, _pVideoCaptureFilter, NULL, /*WHAT TO PUT HERE???*/);

            // Connect the window
            _pVidWin->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS);
            RECT rect;
            GetClientRect(hWnd, &rect);
            _pVidWin->SetWindowPosition(0, 0, rect.right, rect.bottom);

            // Run the graph.

            _bRunning = true;
            success = true;
            AfxMessageBox(TEXT("Could not create Filter Graph."));
        AfxMessageBox(TEXT("Could not create Filter Graph."));

    return success;



I have a System.Drawing.Bitmap received from a camera, this bitmap refreshes 24fps.

Is it possible to display this streaming image on a WPF window?

Which WPF control should i use? and how can it be redrawn each time?

Since i'm new to WPF, i would be gratefull for a code example, for how to convert, and how to include in the xaml.


Hey !
I've managed to code an application that shows the camera preview stream on a form (native code was needed).
I'm asked to draw on top of the preview (that changes at the speed of 15fps). I managed to put some non-transparent pictures using PictureBox, but I need to do something more complicated like this :

I'm asked to do these both things : 1bit alpha transparency as on the left & 8 bits alpha transparency as on the right. I managed to emulate 1-bit alpha transparency with adding colored rectangles (basically PictureBoxes with BackGroundColors) on top of the stream (7 of them ), but that's everything but correct programming. I tried overloading OnPaint using PaintEventArgs e; Graphics g = e.Graphics; of several controls (the form itself, a PictureBox), but the Background color is always fixed (so no transparency).
Could someone point me to a managed (C# .NET Compact Framework 2 for Windows Mobile 5 or 6) way to do what I'm asked, if not full 8-bits transparency at least 1-bit transparency?
Thanks in advance, hope you liked the picture.


<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure