Log in or register to post comments

screenshot

February 6, 2012 - 4:45am #1

I want a script to take a screen shot from my scene view camera?

screenshot

March 24, 2016 - 8:07am #42

Dear  Stefan

 

may I ask can you re post the scripts in here or send the link to my email :

? Since the linked page is not existed

thx alot

screenshot

March 12, 2014 - 6:55am #41

After trying to work on this the past couple of days and reading a few fourms,

Andriod - Prime 31 plugin with Vuforia works fine. 

Just so I'm not breaking any Prime 31 T&C's I wont copy the code, but I use the 

"Save image to gallery" method and put "saveScreenshotToSDCard" in a private string in same file. ( see the UIManager.cs for the code in Prime31)

Reason why it doesn't work is as mentioned below the player settings for the andriod platform need to be changed.
The "Write access" needs to be set to External (SDCard) to work. I Changed this in mine and worked as expected!

I know im reapeating bits and bobs from other peoples post but I'm just putting it into one for others to read. Hope this helps!

I also use Prime 31 for iOS too and that works as expected too if anyone is wondering.

R.

 

screenshot

January 19, 2014 - 9:13pm #40

Check out this article - http://ralphbarbagallo.com/2012/04/09/3-ways-to-capture-a-screenshot-in-unity3d/

Setting the path for the saved screenshot differs depending on which mobile OS your app is running in, and you'll want to change the name of the file to avoid overwriting prior screenshots. 

* check out Unity Answers for some sample code - this isn't feature of Vuforia, it's from Unity.

screenshot

January 19, 2014 - 6:31pm #39

Yes. I have seen that. that is how I created my starting code. but what I need is what isn't on that page. like setting location and also every screen shot overwrites one another.

screenshot

January 19, 2014 - 6:20pm #38

screenshot

January 19, 2014 - 5:14pm #37

I am needing an OnGUI  way for getting a screenshot and saving it in an easy to locate location. I would like to be able to use Application.persistentDataPath thanks

screenshot

January 10, 2014 - 11:20am #36

hi David, now, the black screen make me crazy. i dont really understand how to use Background Texture Access sample to solve the problem.

may i know that what it means by deactivate Background camera ... activate AR camera...? 

or can someone show me by step to step... i m newbie and i hope to settle it as soon as possible, or i ll gonna killed~

thanks

screenshot

January 10, 2014 - 8:47am #35

screenshot

January 10, 2014 - 8:28am #34

hi,

can anyone show me the scripts (C#) how to take Screen shot and save to camera roll...

i m new in unity, i buy prime31 etcetera but do not sure about how to use it.

 

pls.... help...

screenshot

July 14, 2012 - 8:48am #33

What's the problem that you're encountering?

Unity's Application.CaptureScreenshot method will save a screenshot to the file system as a png. The screenshot should contain both the camera image and augmentation, as long as this method is called after the scene has had a chance to render everything. Here's an example of calling it from the OnGUI method:

void OnGUI() { if (GUI.Button(new Rect(20, 20, 150, 100), "CaptureScreenshot")) { Application.CaptureScreenshot("Screenshot.png"); } }

For this to work on Android, Write Access needs to be set to "External (SDCard)" in the Player Settings. The file will end up in the sdcard/Android/data/<bundle id>/files folder. Make sure the sdcard is not mounted when running the app, otherwise the file will not be written. On iOS, the file will end up in the application Documents folder. To access this folder from iTunes you need to add the UIFileSharingEnabled key to your Info.plist file (in the Xcode project Unity creates).

screenshot

July 13, 2012 - 9:20pm #32

@purplelilgirl can you pleeeease please post all your code for the Application.CaptureScreenshot -> GUI -> Xcode??? I've been having trouble with this for the longest time... You would be a total lifesaver!!

Re: screenshot

June 18, 2012 - 9:25am #31
gotmilk wrote:

Hi m3ndi3

I was the guy who asked that question and yes i got the screenshot to work. But... there was some strange issue when images got saved to camera roll. Seems like there is a still issue with Vuforia + Prime. Some of my pictures got corrupted. (some parts of it were black)

I asked the author about this and he suggested my to contact Vuforia about this issue. The screenshot feature without Vuforia worked perfectly, but when i put two of them together then some images got corrupted.

If Ksiva or any other QCAR member would like to take a look, i would happily send my project files. Maybe it would help to get those two plugins working together perfectly.

No solutions on partly-corrupted images yet? I'm trying to take snapshots with Vuforia and Etcetera-Prime31 but sometimes images are corrupted.

Any news?

Re: screenshot

June 1, 2012 - 1:49am #30

Hi,

@elixirbash in my project, I use Application.CaptureScreenshot, and then I use a GUI to display the screenshot. You'd need to use WWW to load the image file from the Documents folder though and then assign it as the texture of the GUI.

I also have figured out a way to save the picture to the camera roll though, by writing a simple plugin that would just call a function in XCode that saves the screenshot in Documents folder to the Camera Roll, using UIImageWriteToSavedPhotosAlbum. I can post some codes if anyone is interested.

Thanks :)

Re: screenshot

May 7, 2012 - 4:28am #29

Hi ,
im saving the screen shot using Application.CaptureScreenshot() .After saving i throw two options share /retake.All these works fine but im not finding a way to show the screenshot preview to the user.

Once user clicks "capture" button , i'd like to show the the stored screen shot or just freeze the entire screen.Could you help me out in this?

Thank you
Mukundan

Re: screenshot

April 9, 2012 - 12:51pm #28

How has the progress on finding a fix been? I'm hoping that I'll be able to use the two plugins by this week for my project...

Re: screenshot

April 2, 2012 - 7:07am #27

Sure, if you send the project files to

we'll take a look. You'll probably need to use a file sharing service to send them. You can use this if you'd like: http://me2u.qualcomm.com

- Kim

Re: screenshot

March 31, 2012 - 6:58am #26
m3ndi3 wrote:

The guy who asked said it seemed to work... If you try this, can you please post if it works??

Hi m3ndi3

I was the guy who asked that question and yes i got the screenshot to work. But... there was some strange issue when images got saved to camera roll. Seems like there is a still issue with Vuforia + Prime. Some of my pictures got corrupted. (some parts of it were black)

I asked the author about this and he suggested my to contact Vuforia about this issue. The screenshot feature without Vuforia worked perfectly, but when i put two of them together then some images got corrupted.

If Ksiva or any other QCAR member would like to take a look, i would happily send my project files. Maybe it would help to get those two plugins working together perfectly.

Re: screenshot

March 30, 2012 - 2:22pm #25

I found a fix for Prime31 + QCAR here

[QUOTE" />QCAR doesn't have a post processing integration that plays nice with other plugins like ours. To work around the issue do the following:

- import QCAR
- rename PostprocessBuildPlayer to PostprocessBuildPlayer_QCAR
- import any prime31 plugin
- build and replace [/QUOTE" />

The guy who asked said it seemed to work... If you try this, can you please post if it works??

Re: screenshot

March 9, 2012 - 9:35am #24

Some users have had issues with the Prime31 plugin and Vuforia. The plugins don't seem to play well together. Just a heads up.

- Kim

Re: screenshot

March 9, 2012 - 5:09am #23

after a quick check on unity answers it seems like that's not possible directly from unity. so i guess the previously mentioned plugin from prime31 is the easiest way. but i haven't tried it myself.

Re: screenshot

March 9, 2012 - 1:07am #22

I think there is a prime32 plug-in that allows you to put images into the camera roll: http://prime31.com/unity/

Re: screenshot

March 8, 2012 - 5:00am #21

This is all nice. But i would like to create an app where i push the screenshot button and the sceenshot will appear into ipad photo album (camera roll). How can this be done? Do i have to start playing with native code or can this be done in Unity?

Thanks

Re: screenshot

March 7, 2012 - 1:36am #20

right-click on that file and then click "Show Package Contents".
best,
stefan

Re: screenshot

March 7, 2012 - 12:53am #19

Hey,

When i download the file with the above method you linked me to, it downloads a xcappdata file and not a png. How do i download the png in the app folder?

Thanks

Re: screenshot

March 6, 2012 - 9:37am #18

thanks macsrok, i know that but this is not the issue we are talking about here. the problem is that in an iOS app the video of the background image is apparently not visible in the screenshot in unity 3.4.2 while in 3.5 it is.
best,
stefan

Re: screenshot

March 6, 2012 - 7:50am #17

There was a bug in the encodeToPNG function in unity 3.4.2 on android. This has been fixed in Unity 3.5. Unity could read the png files it encoded but they were not valid pngs and other applications couldn't read them.

Re: screenshot

March 6, 2012 - 6:53am #16

sorry, i forgot, here is a link with the description on how to get the screenshot in xcode:
http://stackoverflow.com/questions/6121613/browse-the-files-created-on-a-device-by-the-ios-application-im-developing-on-w
best,
stefan

Re: screenshot

March 6, 2012 - 6:51am #15

hi,
as i said i don't have an ios device available all the time so it might take some time. but i'll give it a try as soon as i have the chance.
by the way, is there a particular reason why you don't simply update to 3.5?
best,
stefan

Re: screenshot

March 6, 2012 - 5:19am #14

hey Stefan,

I know this might be too much to ask but can you downgrade to 3.4.2 version of unity and check if this works? Would be great if you could

Thanks for your help so far!

Re: screenshot

March 6, 2012 - 3:36am #13

Thanks. will test it out. Can you tell me where i can find the screenshot on the iOS device?

Re: screenshot

March 5, 2012 - 1:59pm #12

ok, i finally managed to test it and i get a perfect result on iOS and Android. in both cases (tested on an xperia x10, running android 2.3.3 and an iPhone 3gs, running iOS 5.0.1) i get a screenshot with the menu, 3d elements and the background in it. i attached the two screenshots. what i did was simply importing the Android and iOS Image target sample and add the attached little script (it's a .js but i had to rename it to .txt!) to the AR camera. i used the latest vuforia versions and unity 3.5.

@oba: by just using this script on Android the screenshot on my device can be found under "sdcard\Android\data\*app_name*\files\TestShot.png"

Re: screenshot

March 5, 2012 - 12:21pm #11

stefann , what is the path of the saved screenshot on your android ?
i tried your code
Application.CaptureScreenshot("Screenshot.png");
but i can`t find the saved screen shot !!

Re: screenshot

March 5, 2012 - 10:42am #10

My bet is that you'll either have to capture the screenshot on the native level or render the QCAR feed onto a mesh inside Unity so Unity actually "sees" the feed. Rendering to texture inside Unity has been available since QCAR beta 1.5

Re: screenshot

March 4, 2012 - 10:30pm #9

Yes, i trigger it when a button is pressed.

Re: screenshot

March 2, 2012 - 3:50am #8

ok, i might have access to an iphone a bit later today then I'll give it a try.
how do you trigger the Application.CaptureScreenshot()? when you click a button or somehow else?

Re: screenshot

March 1, 2012 - 10:47pm #7

Thats so strange. Am i doing something wrong or is this a bug? Im attaching a screenshot of what I'm getting with Application.CaptureScreenshot()

Any help would be highly appreciated!

Re: screenshot

March 1, 2012 - 10:51am #6

Hi,
i'm sorry i just have an android tablet available and there everything works as expected.
i use

function OnGUI() {
    if (GUI.Button(new Rect(10,10,150,150),"ScreenShot")){
           Application.CaptureScreenshot("TestShot.png");
    }
}

and get a perfect screenshot with the camera image and the gui elements. maybe someone else can give you a hint.
best,
stefan

Re: screenshot

March 1, 2012 - 12:09am #5

When i take a screenshot on my iPad, Application.Screenshot just displays what unity renders , so what I'm getting here is just my GUI with a black background.

This is obviously not what I'm looking for. What we need is the camera feed along with the augmentation and the gui (basically what we would see on the device). If you can get this working it would be great if you can tell me how i can go about this

Im using unity 3.4.2 pro with the latest vuforia sdk(iOS)

Re: screenshot

February 29, 2012 - 3:02pm #4

are you trying to do this on the phone or on your computer? i haven't used it with 1.5 but i have used EncodeToPng as well as Application.Screenshot with version 1.0.6 on android without any problems. i'll give it a try tomorrow but i don't see why it shouldn't work...
best,
stefan

Re: screenshot

February 29, 2012 - 8:24am #3

ok, so Application.Screenshot wouldn't really work as the camera feed wouldn't show up in that. Ive gone ahead and traied it and now I'm sure it doesn't work. other than the gui the entire screen appears black in the screenshot.

One way I'm guessing would be to get the camera feed and render it out to a texture and then encode to a png.

Any suggestions on how i can get that raw camera data which i can send to EncodeToPng?

Re: screenshot

February 6, 2012 - 8:08am #2

oh, come on. use the unity scripting reference...
http://unity3d.com/support/documentation/ScriptReference/Texture2D.EncodeToPNG.html
or, even easier:
http://unity3d.com/support/documentation/ScriptReference/Application.CaptureScreenshot.html
;-)
best,
stefan

Log in or register to post comments