|
it is possible for a camera to take a picture and save it as jpg? I could not find on google or unity.
(comments are locked)
|
|
Yes, it is possible. And there's even a couple of different approaches you could use: There's a script for taking screenshots on the Unifycommunity Wiki: TakeScreenshot The method used to do this is: Application.CaptureScreenshot, [EDIT: Which also has a parameter superSize for high resolution screenshots using an integer multiple of the current screen resolution] There's also an approach to do [-high resolution-] screenshots [EDIT: with any arbitrary resolution]. I have a script which is based on the script posted in Submitting featured content. This will take a screenshot and store it to disk when you press the key "k" (you could change the key by changing the code). You have to attach the script to a camera for it to work:
It also shouldn't be too hard to post those screenshots to combine this with the example code in the WWWForm-documentation to post those screenshots to a server. I dont now if this is a common issue, but i had to use the function in the LateUpdate call, some of my objects, which i create with Graphics.DrawMesh() were not on the screenshot.
Jul 21 '10 at 04:28 PM
Case23
Good point - I've changed the code to use LateUpdate() instead of Update() to be on the safe side.
Jul 21 '10 at 10:42 PM
jashan
Hi,Jashan i dont want to save the screenshot,but i just wanted to display it to a smaller view beside my game,can you help me
Dec 29 '11 at 08:41 AM
wenhua
If you have Unity Pro, you could use render textures for this purpose. That won't have your GUI included (if you're using UnityGUI), though. Another thing that might be possible is saving the screenshot to disk first, then loading it, then creating a texture from it. Haven't tried that, yet, but theoretically it should work (at least in environments where you have disk access).
Jan 06 '12 at 09:48 AM
jashan
@Cawas: Not sure if the parameter "superSize : int = 0" was added later to Application.CaptureScreenshot, or whether I missed it when I wrote the original answer. In most cases, using CaptureScreenshot is probably the best way to do it. An advantage of the other script may be that you can use any resolution, not just multiples of the current screen resolution. I'll edit the wording to reflect that change.
Dec 11 '12 at 01:58 PM
jashan
(comments are locked)
|
|
You could try this: http://unity3d.com/support/documentation/ScriptReference/WWWForm.html Which from the link in this Answer: http://answers.unity3d.com/questions/292/is-is-possible-to-output-screenshots-from-unity
(comments are locked)
|
|
Yes. Take a look at JPEG Encoding in Native Unity JavaScript by Matthew Wegner, Flashbang Studios.
(comments are locked)
|
Here is a code snippet that should help you:
(comments are locked)
|
|
Jashan code works when you play in editor, however when build and play the screen shot image was blank , was is due to render target has been changed to 'RenderTexture'?? however i tried just saving the texture without render target texture then it worked fine..:) Thank you so much for your suggestions above..:)
(comments are locked)
|
1 2 next page »

interesting article about 3 ways of doing it: http://ralphbarbagallo.com/2012/04/09/3-ways-to-capture-a-screenshot-in-unity3d/
By the way, asset store has now a script to do it and store it in iOS and Android gallery. Great responsive developer behind it, I've used it and approved: http://u3d.as/content/ryansoft/gallery-screenshot/4pz