How to draw/render RAW RGB24 image buffer by using GDI+?
Hi Experts,
I am beginner to use GDI+ window image library to render images.
I have used Image object to render image from file.
BUT my project that need to render buffer that captured from webcam to other place by using GDI+.
I know that we can use Image buffer with IStream but I don't know how to make it work?
Can you help me to let me know how to do this?
1. Render a buffer that captured from webcam (RGB24)
2. Real time update the buffer and render? it mean do we have any way to use stream to write for update or for each frame we need to create image object again and do render again?
In what format is the raw data?
It might be possible to copy each fram's data directly into a DIB Section and then blit it to the screen.
Kimpan
Why don't you try to use DirectShow? If you want the image frame, you can add SampleGrabber filter right after the webcam source filter and use NullRenderer filter in the end (if that is intended).
If you just want to show the live video from a webcam in your own window, create a directshow graph containing the webcam source filter, let DirectShow find the filters needed and in the end of the graph there will be a VideoRenderer. Put your window handle in the VideoRenderer and start to play.
Yah, I know these way BUT my project is using GDI+ for project images, the example above just for explaining.
My functions that need to receive webcam buffer (format 320x240, RGB24), process this buffer and return back. finally i will get return buffer to show to the control, the buffer will send at real-time to my function so it is always updated.
My question is that if we have any function that is using GDI+ to update the buffer (not create new image or bitmap) for each render.
It might be possible to copy each fram's data directly into a DIB Section and then blit it to the screen.