Results 1 to 4 of 4
Discuss Two questions about taking pictures via CameraController at the Free Toolchain Software (Cydia App's) - Hackint0sh.org; I'm trying to take pictures via my camera without using the official camera funtions in ...
  1. #1
    Rookie Array

    Join Date
    Aug 2008
    Posts
    12
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default Two questions about taking pictures via CameraController

    I'm trying to take pictures via my camera without using the official camera funtions in the official SDK.

    Therefor i dumped some classes from "PhotoLibary" using class-dump. I followed some tutorials which i found on the internet and read in the book "iPhone Open Application Development".

    With the code below i can succesfully build the application without any errors and warnings. When i click on the button "Take photo" nothing happens, i've placed some NSLogs to see what happens and i see the methods "cameraControllerReadyStateChanged" and "tookPicture" being executed. My tookPicture funtions looks like:
    Code:
    - (void)cameraController:(id)sender tookPicture:(UIImage*)picture withPreview:(UIImage*)preview jpegData:(NSData*)rawData imageProperties:(struct __CFDictionary *)imageProperties
    {
    	NSLog(@"::cameraController method executed");
    	NSAutoreleasePool* pool = [NSAutoreleasePool new];
    	{
    		imageName = @"1";
    		imagePath = [NSString stringWithFormat:@"/var/root/Media/Photo/Photo_%@.JPG", imageName];
    		logPrefix = @"Trying to write the picture to: ";
    		NSLog([logPrefix stringByAppendingString:imagePath]);
    		[rawData writeToFile: imagePath atomically: NO];
    	}
    	[pool release];
    }
    As you can see i'm trying to write the file to "/var/root/Media/Photo/Photo_1.JPG". The directory does exists and i've chmod the directory to 777. The problem is nothing being writed out there, no picture is taken... There are no errors and/or warnings in my console when i'm trying to take a photo. So i really don't know where to look.

    The following code is being executed when i click on the button "Take Picture":
    Code:
    NSLog(@"::takePicture method executed");
    CameraController *camera = [ [ CameraController alloc ] init ];
    [camera setDelegate: self];
    [camera startPreview];
    [camera capturePhoto];
    [camera stopPreview];
    Another question, i've also a button called "Enable camera". My idea about this is when i click on this button, a sort of preview mode is being started. I've created a UIImage thing with Interface Builder and made a class outlet of this UIImage. How can i "print" the current camera view into this UIImage?

    Thanks for your help!

    PS. Tried on both iPhone 3G and iPhone 2G without succes. Both running 2.0.1. (jailbreaked via PwnageTool). As you can see i'm developing using Xcode on Leopard.



  2. #2
    Rookie Array

    Join Date
    Aug 2008
    Posts
    12
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I found out my application was running in a sandbox and because of that i couldn't write files into the directory i was trying to. I used the function NSHomeDirectory() for retrieving the directory of the sandbox. At that directory i was able to write my images to.

    Now, i really would like to know how i can use a sort of preview mode. Tried many things but nothing works so far.
    Can you guys help me out with this one a little bit?

  3. #3
    Rookie Array

    Join Date
    Aug 2008
    Posts
    12
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by Xino View Post
    I found out my application was running in a sandbox and because of that i couldn't write files into the directory i was trying to. I used the function NSHomeDirectory() for retrieving the directory of the sandbox. At that directory i was able to write my images to.

    Now, i really would like to know how i can use a sort of preview mode. Tried many things but nothing works so far.
    Can you guys help me out with this one a little bit?
    Really nobody ?

  4. #4
    Newbie Array

    Join Date
    Feb 2009
    Posts
    1
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default Any luck

    I'm traveling down similar paths.
    Any luck on your app?
    Any source code to share?

    Thanks

 

 

Similar Threads

  1. TURBOSIM pictures
    By g0tcha in forum iPhone "2G" (Rev. 1)
    Replies: 3
    Last Post: 12-06-2007, 11:11 AM
  2. Taking direct pictures from iphone to pc
    By CrYzM3 in forum General
    Replies: 1
    Last Post: 09-19-2007, 07:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 03:46 PM.
twitter, follow us!