HIde shutter animation UIImagePickerController - iphone

I want to hide animation that shows shutter opening while presenting UIImagePickerController to take picture. I checked this question for the same which contains the accepted but I was unable to replicate that functionality in my controller.
I gave overlayView as self.view and when I hide PLCameraView it shows blank white portion and than I am able to take picture. Is there any way to remove that white portion ?
IF needed I can post my full sourcecode project...
Can some body please highlight how to do this ?
Edit:
What I want to do is based on certain event and conditions I want to place image taken from camera or default image in db. And picture taking doesn't involve user interaction so I put NSTimer and take snapshot with the help of takePicture method.
Any thoughts ?

Instead of messing about with the view hierarchy of UIImagePickerController (which you are forcefully warned against in the docs) you should probably use AVCaptureSession and create your own ImagePicker to capture raw images from the video feed.
See http://developer.apple.com/library/ios/#samplecode/AVCam/Listings/Classes_AVCamCaptureManager_m.html for hints.

Related

UIImagePickerController pushed on my own UINavigationalController?

I'm trying to take the UIImagePickerController set to UIImagePickerControllerSourceTypeCamera (ie when it allows the user to take a picture) and push it on my own UINavigationalController but it doesn't work (can't push a UINavigationalController onto another UINavigationalController).
I'm wondering, is there anyway to make a custom version of this camera module, much like you can do with the UIImagePickerControllerSourceTypePhotoLibrary UIImagePickerController using ALAssets? I'd just like to not have to pop up the camera as a modal view and would like to push it on my own UINavigationalController.
You can custom camera using AVFoundation.
Refer Sample AVCam for how to use AVFoundation for it.
Your main issue is that the UIImagePickerController is itself a UINavigationController, so pushing that onto a navigation controller is going to have problems (as you've already found)
As Prince has mentioned, your best bet is to use the AVFoundation to create your own. The downside is you'll (by default) lose the nice features of the camera app such as touch to focus, pinch to zoom etc. but these can all be added yourself.
Check out this tutorial which gives you a nice explanation on how to use the AVFoundation library for this, and also shows you how to add things like an overlay to the camera screen. Then you can easily find on google/stackoverflow how to add things like tap to focus :)

creating instruction screen in iOS

I often time see in an iOS apps when you first launch the app there will be a one time instruction with arrows and such to show a first time user guide. It's usually a black transparant colored screen with arrows. I was trying to find a few app that does this, but I couldn't. Was wondering if someone knew the terms for these and how to create it?
Create a UIView and place it above the view you're wishing to guide the user through. Set up the UIView as a IBOutlet in your classes header file, set the background to black and set the alpha to 0.3 or something similar (test to see how it looks).
In header:
IBOutlet UIView *overlayView;
In main:
overlayView.alpha = 0.3f;
You may want to make sure that the overlay shows the first time the users opens the app or maybe store a value in a database for when the user dismisses the screen so that you don't show it again. To do this you can hide the UIView or simply set the alpha to 0.
Then simply add images or annotations to the UIView. As "bentford" said it's quite broad but this should get you on your way. You can also use multiple UIView's or even transformations to animate the screens.
I use Skitch. You can find it in the Mac App Store.
Skitch can take the screenshot in the simulator and overlay the arrows and notes. Then when you launch the app, you show the image created with Skitch in a UIImageView on top of the actual view. Then just hide the UIImageView.

how to reload a view again and again

hi i am a new iphone programmer
i am creating a imagedisplay type application where i have to display images on a view and by presssing a next button a new image should appear on same view (i am using database)...
therefore i need to reload my current view again and again...each time when i click that button....
i tried some suggesion which are given on this website but not satisfied because many of them are based on timer...
please help.....
May be I have missed something in your question. But why you need to reload the entire view? You are using an UIImageView to display your image, right? And you are not showing any kind of scroll, but only a next button, right? Then why don't you just set the image property of UIImageView when the button is tapped.
// in button handler
myImageView.image = [UIImage imageNamed:#"new_image.png"];
Perhaps you could use a paged UIScrollView with three uIImageViews and always have the previous, current and next image loaded. This way when the user hits next, it scrolls animated to the next image. When page 3 is loaded, it programmatically sets the second image view as the desired next image, sets the image you came from on the first image view, and sets the scroll view non-animated to page two and loads the next image in the third image view.
Sounds complicated but basically you are giving the appearance of an infinite scroller but only pulling one image at a time except for initial load of three.
You could try looking at the "PageControl" Example Project in the XCode Documentation. It should give you a good starting point.

Display an image for a few seconds

I want to be able to display an image on the iPhone when the device is shaken. I can play a sound but also want to pop up an image at the same time.
Any ideas on how to do this would be appreciated.
thx,
wes
How I would do it?
In your header file, define an UIImageView.
When your device is shaken, init the view with the right frame
Load an image in that UIImageView.
Add that UIImageView to the view that is currently shown.
Create a NSTimer which has an interval of the time you want to show your image
When the timer hits its interval, remove the imageview from the view.
I am not putting all kinds of code here, because you also supply no code whatsoever, but I think you can figure it out yourself.

UIScrollView: Activity Indicator while loading image from url

I need an Activity indicator spinning in a modal view that has an UIScrollView while
the content of the ScrollView (an image from url) is loading.
Any ideas of how to get this done?
As a plus I need to know how to tell the ScrollView to behave like the Photos Iphone Native App, I mean, load an image, adjust it to fit the screen without loosing aspect ratio.
Thanx!!!!
You need to use two steps:
First, download the image and display the activity indicator
When done, display the image and remove the activity indicator
The tricky part is it probably won't work if you just use NSData's initWithContentsOfURL: because it is a blocking call. On the Mac you can use NSURLDownload to download content asynchronously, you should check if this is available on the iPhone SDK.
For using a UIScrollView to display an image and fitting it to the screen at first, you should check the ScrollViewSuite sample code. It does exactly what you are looking for.