Thanks for the fast reply bro, i fixed the darkness of the picture , the only problem is after i take the picture, the image that return is too small, i have been playing with this code line
Oh, you mean small like that, lol. I thought you were talking about the resolution of the image. The code that instantiates that small quad is for demonstration purposes only; if you want to show the image in full screen, you should ideally create a full screen RawImage object and assign the camera texture to its texture property.
In essence, you can use the Texture2D texture object however you want. For example, to display the captured image in full screen, add a public UnityEngine.UI.RawImage rawImg; variable to your script and call rawImg.texture = texture; inside NativeCamera.TakePicture. Then, create a fullscreen UI-Raw Image object in your scene and assign it to the Raw Img variable of your script.
First of all, thank you fro creating such amazing free assets, I’m already using the camera to take a screenshot for an AR project.
I’d also like to add in a feature where the use can record the video feed of their AR experience on android/iso similar to the ARStickers app.
Is there a way to record the camera feed and include the UI and AR parts? I tried to use the Record method, but the app froze maybe because the camera is already open…
Do you have any recommendations for recording camera feed with the UI and AR… Or continuous screen recording?
We’ve run into a bit of a problem on Android with 16M (5312x2988, 16:9) pictures crashing the app in the background. 12M (3984x2988, 4:3) and below seem to work fine on our test device. Currently using Unity 2018.2.8f1. The device logs seem pretty barren of anything helpful.
iOS and video recording work fine.
Any help or ideas would be much appreciated, thanks!
If you don’t do anything in NativeCamera’s callback, does it still crash the app? If not, then try putting Debug.Log lines in between each line in the callback function to pinpoint the problematic line.
The callback into Unity is never called when taking a 16M picture. If the crash happened in our app’s callback function it’d be much easier to find the problem, but as it is I can’t get any decent logs out. From the user’s perspective, after pressing “Ok” in the camera to confirm the photo taken, the app restarts itself in the background and the callback cannot find its intended target since it doesn’t exist anymore. At least that’s what I’m assuming is what happens.
It seems like Android OS kills Unity app to free up some memory. This happens when device runs out of memory. Please try your app on a newer device or a more powerful emulator and see if the issue persists.
Hi,
When using the provided TakePicture example code I witnessed the images were available in my Android’s gallery. That worked for awhile, but now I no longer see the images added to gallery. I’ve tracked down the path on my device to see if the image exists and it appears to not be there. Maybe I’m doing something wrong, or witnessed an anomaly that should never have happened. Either way just curious if there would be a way for me to provide a path to save a captured image to the file system? Thanks
Images shouldn’t appear in the gallery, a segment of the code is actually dedicated to deleting those images. In NativeCamera’s callback function, you can copy the file to a specific path, if you want.
Hello, everything is working great with the asset but the video that is recorded doesn’t seem to be saved in memory, only the picture that is taken is being saved in device memory.
Thanks for all the work though, great job.
Are there any other properties accessible on that object other than the ones that are being returned? Specifically looking for the last modified date of the image.