take picture using cocos2d-x

Hi, All:
I want to use cocos2d-x to take picture. Using UIImagePickerController in cocos2d, but how to use in cocos2d-x?
What I should do ?

Thanks !

You can mix use c++ and objective-c in an .mm file.
Refer the engine, there are many files named xxx.mm.

Thanks for Minggo’s reply。
but,I can’t understand you.
I develop at platform-android, all the files I writed was xxx.cpp . I change xxx.cpp to xxx.mm ?? If this, how to compile the xxx.mm on windows?
Can you tell me in detail.

Thank you!

I develop android’s app,not IOS’app

You said you want to use UIImagePickerController.
It is a iOS’s API, how can you use it on Android?

fist,thanks for your replying.
I’m sorry, I didn’t express myself clearly.
I want to take picture by cocos2d-x , what I should do ? use jni ? Pleae help me.

Thank you!

I think that you need some code to take screenshot like this post. But in cocos2d-x

http://karnakgames.com/wp/2011/02/how-to-take-in-game-screenshots-with-cocos2d-and-upload-them-to-a-facebook-album/

Sorry, I don’t know the answer.

Stephen Wu wrote:

fist,thanks for your replying.
I’m sorry, I didn’t express myself clearly.
I want to take picture by cocos2d-x , what I should do ? use jni ? Pleae help me.
>
Thank you!

Yeap, you should use jni to invoke Android API.