Flash OCX

Started by
2 comments, last by x_igor_x 18 years, 7 months ago
I don't know is this right place for my question, but i am doing c# directX9 application that needs to integrate Shockwave flash ocx control. I need to render flash movie to Direct3d texture. Only way i see is to render single frame on the movie to bitmap and then copy the bitmap to direct3d texture. Please Help! How to render single frame with Flash OCX? Igor
Advertisement
Quote:Original post by x_igor_x
Only way i see is to render single frame on the movie to bitmap and then copy the bitmap to direct3d texture.

Various people have posted questions about getting flash into D3D, and there doesn't seem to be a particularly easy option. Most people seem to get as far as your own suggestion - Flash->Bitmap->Texture.

I can't find the link right now, but there was an open source flash rasterizer written for OpenGL that might be useful (if you can find it). Although from what I read of it, it was still (early) work-in-progress, and you'd also have to port from OpenGL to D3D...

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

In straight up C++, I got it working by creating an ActiveX container with the control in it, getting the handle to the control's window, creating a bitmap/device context pair, and then calling SendMessage(hWndFlash, WM_PAINT, hDC, 0), where hWndFlash is the flash control's window handle, and hDC is the handle to the device context that is paired with the bitmap I created. I then lock a DirectX OffScreenPlainSurface and call GetDIBits (after filling in the BITMAPINFOHEADER structure) to copy data from the bitmap to the surface. From that point, I use StretchRect() to copy the surface to my texture. I had the extra surface in there at one point for a reason, though now given my current usage I'm wondering if I would have been fine just creating a texture of the appropriate type (dynamic, or rendertarget, perhaps?). Either way, it gets the job done. Of course, this is all using the Win32 API and the old GDI. Dunno what it'd be like using .NET and GDI+.
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke
Quote:Original post by Agony
In straight up C++, I got it working by creating an ActiveX container with the control in it, getting the handle to the control's window, creating a bitmap/device context pair, and then calling SendMessage(hWndFlash, WM_PAINT, hDC, 0), where hWndFlash is the flash control's window handle, and hDC is the handle to the device context that is paired with the bitmap I created. I then lock a DirectX OffScreenPlainSurface and call GetDIBits (after filling in the BITMAPINFOHEADER structure) to copy data from the bitmap to the surface. From that point, I use StretchRect() to copy the surface to my texture. I had the extra surface in there at one point for a reason, though now given my current usage I'm wondering if I would have been fine just creating a texture of the appropriate type (dynamic, or rendertarget, perhaps?). Either way, it gets the job done. Of course, this is all using the Win32 API and the old GDI. Dunno what it'd be like using .NET and GDI+.


tnx. it might work. i'll try it.

This topic is closed to new replies.

Advertisement