Jump to content
  • Advertisement
Sign in to follow this  

Flash OCX

This topic is 4612 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!