|
Is this possible? I've been trying to pass as: byte[] bytes = screenShot.EncodeToPNG(); but Flash receives as CLIObject and if I try to use as ByteArray it returs as a null obj.
(comments are locked)
|
|
[solved] a friend just found an easy way of doing that. var bmp:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, false); stage.stage3Ds[0].context3D.drawToBitmapData(bmp); where do you call stage.stage3Ds[0].context3D.drawToBitmapData(bmp)? because it for me it gives "Error #3692: All buffers need to be cleared every frame before drawing", which means I'm not calling that function between render and present or something like that.
Jul 31 '12 at 12:01 PM
Paulius Liekis
Found my problem: you need to use WaitForEndOfFrame. In my case I was using that, but calling something more (like Applicaiton.CaptureScreenshot) which, I guess, was conflicting with stage operations.
Jul 31 '12 at 01:02 PM
Paulius Liekis
Hi, Would you mind telling me how you achieved the "Taking screenshot" part, I can't manage to get it working on the Flash build (as far as I'm concerned, nor Application.CaptureScreenshot() nor Texture.ReadPixels() do work on this platform). Thanks
Mar 04 at 09:15 AM
Le nain
You need to use ActionScript function to capture screenshot into BitmapData as explained in this answer, once you have that you can transfer that BitmapData to Unity Texture.
Mar 04 at 04:34 PM
Paulius Liekis
Yeah, thanks, I figured it out a bit after. I thought at first that this was just "passing the file from Unity to Flash", as the title suggested, as I know nothing about AS.
Mar 04 at 04:46 PM
Le nain
(comments are locked)
|

Could you add a few snippets of the code you're using so we can see what you're trying?