- Sort Posts
- 41 replies
- Last post
screenshot
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
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
screenshot
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
That's a good question for Unity Answers - http://answers.unity3d.com/questions/125063/saving-screenshot-to-iphone-camera-roll.html?sort=oldest
screenshot
screenshot
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
Re: screenshot
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
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
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
Re: screenshot
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
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
Re: screenshot
Re: screenshot
Re: screenshot
Re: screenshot
Re: screenshot
Re: screenshot
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
Re: screenshot
Re: screenshot
Re: screenshot
Re: screenshot
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
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
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
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?
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