Scaleform Play a live video in texture? -
i know if it's possible play live video, webcam example, in texture in scaleform?
thanks.
to this, need replace appropriate image inside swf, 1 wraps texture contains video.
you need have video texture in texture graphics api using (for example, in directx 11, you'd need id3d11texture2d
). can create scaleform wrapper image around this, using textureimage
class. need find resource within swf want replace, , set wrapper image image. finally, need call forceimageupdate
on gfx::movie, propagate texture change.
id3d11texture2d* videotexture = ...; ptr<gfx::movie> pmovie = ...; ptr<d3d1x::texturemanager> pmanager = ...; ptr<render::texture> scaleformtexture = *pmanager->createtexture( videotexture, imagesize(width, height)); ptr<textureimage> scaleformimage = * sf_new textureimage(image_r8g8b8, scaleformtexture->getsize(), 0, scaleformtexture); imageresource* pimageres = (imageresource*)pmovie->getmoviedef()->getresource("name_of_resource"); pimageres->setimage(scaleformimage); pmovie->forceupdateimages();
when update underlying id3d11texture2d
(eg. new frame), image in scaleform movie change. example of how shown within textureinswf sample, little more thorough code. if have xboxone sdk, there kinectinswf sample, shows how kinect camera (eg. live video camera).
Comments
Post a Comment