Can I overlay animated gifs with UIImageView on an iPhone? - iphone

I want to overlay an animated gif onto the camera preview on an iPhone with UIImageView.
Currently, following this post: http://www.musicalgeometry.com/?p=1273 I am able to to so with PNGs.
How can I do this with animated gifs? Specifically, over the live view of the camera?

UIImageView doesn't support animated gifs. Checkout this post on how to deconstruct an animated gif and use it with a UIImageView.
Link
EDIT:
Here is a link to the docs on a camera overlay view.
http://developer.apple.com/library/ios/documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html#//apple_ref/doc/uid/TP40007070-CH3-SW21

Related

How do I display the back camera live video feed to an UIImageView?

I have been messing around with the AVFoundation framework for iPhone, but I can't seem to be able to get the information from the back video camera to display on an UIImageView I have in interface builder.
This is a single view application.
I just want to get what the back camera sees displayed on an UIImageView.
Thank you!
You don't need a UIImageView, just a UIView.
Take a look at AVCaptureSession and AVCaptureDeviceInput in AVFoundation. With these you can access the cameras.
AVCaptureVideoPreviewLayer can be used to draw the camera input to a UIView.
http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVCaptureVideoPreviewLayer_Class/Reference/Reference.html
Hopefully this answers your question: http://www.ios-developer.net/iphone-ipad-programmer/development/camera/camera-preview-on-a-view-controller
Please let me know if you would like any more information!

Capture video from iPhone camera with overlay view

I'm creating an augmented reality app which overlays a 3D logo on the iPhone's video camera view using cocos3d.
I need to record the video with the logo overlay and write this to a file.
What would be the best way to accomplish this?
Try to modify this project from apple: here. Add your logoimage in the viewDidLoad method of AVCamViewController. You'll need to clean the XIB from everything but the view.

how to create paginated camera overlays

I am new to iphone development, and i am wondering how would i go about placing a page control as an overlay for the camera, so that a user could swipe and different overlays would be shown for each page? This would have similar features as the The Sampler by Converse.
Firstly there will be the camera
on top will be a scroll view (paginated)
each page will hold an image that is overlayed over the camera
4.(extra) i would like that image to zoomable
How would i go about writing this, or could someone point me in the write direction cause i am new to iPhone dev,
You could use a UIScrollView with paging enabled, as someone else noted. There are some examples out there already of how to do this. Check this one out: https://github.com/mwaterfall/MWPhotoBrowser.
My best suggestion would definitely be to checkout the source for the PhotoScroller app by Apple: http://developer.apple.com/library/ios/#samplecode/PhotoScroller/Introduction/Intro.html
Just add a UIScrollView to your view and add the images as subviews to your picker. Make sure you enabled Paging on the scrollview as well.
You would need to use the cameraOverlayView property of UIImagePickerController
The cameraOverlayView will essentially be a paginated scrollview, you can follow this sample code to see how to create and use cameraOverlayView:
PhotoPicker
Play with OverlayViewController in the above code and you'll achieve it.
For the zoomable image, you just would add a scrollview and display the image in it. The UIScrollView delegate has this method:
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale.

Customization of UIImagePickerController

I am working on camera application in which I want to set the screen of the camera i.e camera window appear for particular frame. And in front of camera screen the cut out image is coming so that user can see the background through the cut out part of the image and capture the image. So any one know to do this i.e. customization of UIImagePickerController.
UIImagePickerController has a property named cameraOverlayView. Use this to set your camera overlay as any view you like. Use normal view transparency for letting the user see parts of the live camera view.

I want to use an overlay for the UIImagePickerController, but I want the shutter animation

I am using the UIImagePickerController with an overlay view so I can have some custom controls. I notice that when the user clicks the "Capture" button and I call [imagePicker takePicture], the shutter animation doesn't occur. The effect is that I see the view sort of freeze and then continue in camera mode for a second before the image is captured and I display it over the camera view.
Make sense?
So, in other words, when the UIImagePickerController is initially presented, you see the shutter animation open up to reveal the camera, but when using overlay views and hiding camera controls, when I take the picture I don't see it. Would really like to. :-(
Any ideas?
There is currently now way to do this with the built in UIImagePicker animation. You would have to use AVFoundation and roll your own capture animation whenever you take the picture