Sign in to follow this  
x_igor_x

Flash OCX

Recommended Posts

x_igor_x    122
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

Share this post


Link to post
Share on other sites
jollyjeffers    1570
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

Share this post


Link to post
Share on other sites
Agony    3452
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+.

Share this post


Link to post
Share on other sites
x_igor_x    122
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this