how to show device camera's data on a CCScene when using cocos2d-x on android - camera

In an android game, I want to start device's camera and let player see the camera input inside a CCScene. Does anyone know how to do that?

I am searching for the same thing. I haven't figure it out yet but come across the following:
http://syswerke.com/projects/blog/opencv-camera-capture-in-cocos2d-x-applications/
http://docs.opencv.org/doc/tutorials/ios/video_processing/video_processing.html#opencviosvideoprocessing (iOS)
http://www.cocos2d-iphone.org/forums/topic/using-a-uiimagepickercontroller-and-cocos2d-sample-code/#post-34228 (iOS)
http://www.cocos2d-x.org/forums/6/topics/11524 (suggesting to save to file/buffer and pass to native code)
I've seen example on iOS that works (e.g. https://www.youtube.com/watch?v=TM9EIzB5I-8).
I'll update more if/once I figure it out

Related

ReactNative doesn't respond to OrientationChanges

I'm trying to implement a navigation that pushes the user to a different screen when switching to landscape mode. I've tried for several hours now to implement an event listener to respond to an orientation change, which didn't work (I tried different examples from different websites).
Now, I took a full code example from here and here which also didn't work at all. (The first one just changes the text on the screen depending on the orientation, even that didn't work for me -.- )
I also tried to look into ScreenOrientation from Expo-Cli directly (expo-screen-orientation), but don't really get the documentation tbh.
I tried the orientation change on both an android emulator and my android phone (both Android 10).
Is there something I'm terribly missing here? How come that my app not respond to orientation changes?
Have you checked that the Device Orientation is not forced to Portrait in Xcode ? To check this go in Project -> General -> Device Orientation
Had the Device Orientation locked inside the app.json -.-

React Native: Multiple previews of camera stream

I've got an application in React Native to be developed in Android and iOS, in which I'd like to take the camera stream, make some processing, and render it multiple times.
Imagine an app like Instagram, in which you can add filters to the camera live and it shows the applied filters with on live previews. It would be more or less the same.
I need to get the camera stream and be able to show it on screen multiple times.
I've tried react-native-camera, but it only lets me to get one instance of the camera to be shown.
With this same library, I've tried to take pictures in intervals of the camera and to render them via <Image> container but, of course, it's a performance kill and the app ends up crashing.
How can I achieve what I'm trying to do? Do you know of any module or any approach that allows me to do so?
Thank you.

How to open the camera within the size?

I want to open the camera action like below pictures. just like camera open within some area only for focusing particular area of the image.
Please help me. Thanks in advance.
Normal Camera View
My Expectation
If you want to use the CameraCaptureTask, you will have to deal with its possibilities. It uses the built-in camera app of the phone, and available setting are the ones in that app.
If you prefer a customized photo taking app, you should use the PhotoCamera class:
PhotoCamera Class
You will find some guidance here:
How to create a base camera app for Windows Phone

Open the iPhone camera?

We need to open the iPhone camera, to take images that will be saved to the camera roll.
I have read many examples here that all of them opens the UIImagePickerView.
Besides the fact that i cant understand why i have to open the picker view in order to open the camera , i just can't do that- i dont want the picker view, because i have my costumed photo album that we build, and we just need to have a little button in it, that opens the camera to take an image . without opening any other views above it .
Is that possible to use the camera without this pickerview that will cover my scene ?
or can i lead the user to the camera app and than take him back to my app ?
Thanks.
Instead of high level (i.e. Apple supplies the UI element) classes, you have to go to a more foundational (lower) level of API's, which would be AVCaptureDevice and AVCaptureDeviceInput.
And Apple has some nice source code available in their AVCam project.
If you want to display camera stream in you app without UIImagePickerController than you should you AVFoundation framework.
Here some some examples and tutorials:
take-photos-with AVFoundation
Custom camera
Displaying camera

Add a video into splash screen or in the first view of the app (IOS xcode 4.0)

I'm a beginner in IOS but I need to show a video when the app is launching.
Please Can you help me?
If is impossible to implement a video on a splash view, there are any idea to create that?
Thanks.
If I have an orthographic mistake, sorry I come from Spain. ;D
The "splash" screen can only be an image to be used as a placeholder until your app is able to start up. Even if you found a way to get a video to play, which I don't think is possible, it is against Apple's HIG for how the startup screen is supposed to be used.
It would be possible to load your video in its own view immediately after the splash screen. You would need to check for a first time run to determine whether to show it, unless you plan to show it each and every time. Hope this helps.
Apple Human Interface Guide