Direct sdk access to camera in an iPhone
I have bought a new iPhone 3g recently and i want to ask a simple question about using the camera of this phone. Does anybody know how to use an iPhone camera directly to use it with an embedded application. But make sure that i am not asking a solution about an UIKit.
Re: direct access to camera in an iPhone
Actually if you want to use the camera of your iPhone without using the apple's sdk then you need to install some native API's on your phone which helps you to do the task as per your expectations. There are many kind of API's available on the world wide web which you may use on your iPhone instead of using an Apple's SDK.
Re: Direct sdk access to camera in an iPhone
I do not have much ideas about making any changes in an application programming interface if an iPhone's sdk. But i am sure that you need to do some changes in the code which will definitely solve your problem. I have tired searching for the code and have found some useless solutions which might make you confusing. Just for the same reason i have not provided the code. But you should try searching it with the code which must be helping you. As i do not have any idea about the coding, I just cannot decide that is it wright one or a wrong.
Re: Direct sdk access to camera in an iPhone
I have provided the code by which you can change the preview of your camera of your iPhone. Though i am not a expert in an Image Picker Camera interface but i just hate that it is so slow and it does not even help you to make changes in the camera preview. First of all you need to build camera controller and make sure that the camera type source is available.
Code:
#define SOURCETYPE UIImagePickerControllerSourceTypeCamera
if ([UIImagePickerController isSourceTypeAvailable:SOURCETYPE]) self.sourceType = SOURCETYPE;
Re: Direct sdk access to camera in an iPhone
You have to make an image picker to update itself automatically which will be allowing it to load before you start messing with its views. I have used Navigation Controller which gives me a "Snap" button.
Code:
CameraController *cam = [[CameraController alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:cam];
[cam performSelector:@selector(updateView) withObject:NULL afterDelay:2.0f];
Re: Direct sdk access to camera in an iPhone
Here i have given the code which adds up the bar button item to the navigation bar.
(void) updateView
Code:
{
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]
initWithTitle:@"Snap"
style:UIBarButtonItemStylePlain
target:self
action:@selector(snapIt:)] autorelease];
// Remove the overlay
UIView *plView = [[[[[[self.view subviews] lastObject] subviews] lastObject] subviews] lastObject];
[[[plView subviews] objectAtIndex:3] removeFromSuperview];
}
You may use the following one to have full screen image.
Code:
(void) snapIt: (UIBarButtonItem *) button
{
[self writeImage:[UIImage imageWithCGImage:UIGetScreenImage()]];
}
Re: Direct sdk access to camera in an iPhone
I have found one google page where they have given provided the whole lot of code which you may use in order to access your iPhone's camera directly. As i do not understand the coding languages, I have given you the LINK which redirects you to the web page where this code has been provided.