UIImagePicker slideshow of images on selection - iphone

Like the Photos App shows, all albums > all photos in a particular album > single photo view,
even I need a similar kind of a view. I have used UIImagePickerController and easily go to the second step. However, whenever I select an image, I can not show a slide show kind of a view, as UIImagePicker does not give me that.
I made another view controller , just to display these images in a pagenation form.
But, from the delegate method, didFinishPickingMediaWithInfo, when an image is selected, I get only that image using:
[info objectForKey:UIImagePickerControllerOriginalImage];
How do I know the images next to this image, and before this image, so that I can create a slide show?

Check out the documentation for ALAssetsLibrary. To obtain a list of images or videos in the Photo library you would use the enumerateGroupsUsingTypes:usingBlock:failureBlock: method of an ALAssetsLibrary object. For instance, you could call this method, then as it asynchronously returns images and video you would build your array of images for the slideshow view.
Also check out this SO thread. The answer shows how to get an ALAsset object from the UIImagePickerController, which lets you find the URL of the image and other info about it.

Related

Change background with an image stored in the iOS device on button's action

I'm developing a messaging app and I want to change the background image of the chat window on tapping the button (like Whatsapp) with an image stored in the device. Can anybody help me in writing code for that purpose?. Thanks!
First of all, you need to create a button, either from XIB/NIB or through code. On the action of that button, you need to change the background image of your view controller's view. Following code may be helpful for you.
-(void)changeBackgroundImage
{
self.objImageView.image = [UIImage imageNamed:#"imageName.png"];
}
objImageView is the object of UIImageView on which you have to show the image.
imageName.png is the name of the image which you want to show on the UIImageView.

HIde shutter animation UIImagePickerController

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.

iPhone - Create an images grid list

I'm developing an application that get images from a website and display to user with a grid view like Photo app by Apple.
When you tap on an image I would to push a view controller that displays images info and other stuff.
What's the better way to implement this? I thought a custom UITableViewCell. (I've seen there are Three20 and AQGridView libs but I'm a newbie developer and the docs are very very poor. Hints?)
Thanks.
I think the UITableView is the best way of doing it. Its memory efficient and your only going to display 3 images anyway so the overhead isn't that bad. A tip, when your asynchronously getting images from the website, create a custom view is a delegate of NSURLRequest, get the data from a webpage, parse the data into a UIImage using imageWithData and when the finished delegate method is called, put a imageview on top of the custom view. This is the best method of downloading asynchronous methods. Good luck!
I made a thumbnail grid list like tableView but multicolumn, it's open source, on
http://www.cocoacontrols.com/platforms/ios/controls/thumbnail-list-view
https://github.com/mohammedDehairy/ThumbnailList

Getting same UIImageView onto two differant class screens (iOS)

I'm working on an iOS app and have had some trouble with getting photos from the user's photo gallery.
What I need help with doing is getting it so that the user chooses a photo from their photo gallery, and then on the next screen the photo is displayed in an UIImageView.
Unfortunately, while I can do this on one screen, I am having trouble with getting it to work on multiple ones.
I've been trying to import the class files from the first screen into the second but it doesn't seem to do much.
I'm getting user photos through a similar method to this tutorial (though slightly differant).
I'm fairly new to objective-c, so no doubt I've made some huge mistake somewhere
Pass the selected image from the second view to the first view. Then set the image to the UIImageView declared in first view.
The best way to pass the selected image is 'delegate' method. Declare a protocol. Implement that in first view. Set the delegate to the second view. So whenever an image is selected in second view, pass that to first view thru delegate method.

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.