# JPImagePickerControllerDataSource

The data source protocol for JPImagePickerController

Extends Protocol: NSObject
Declared In: JPImagePickerController.h

##### Discussion

The JPImagePickerController asks this data source for all data which it wants to display.

## Methods

`-imagePicker:imageForImageNumber:`

  Asks the data source for a image to show in a preview.

`-imagePicker:thumbnailForImageNumber:`

  Asks the data source for a thumbnail to insert in a particular location the image picker.

`-numberOfImagesInImagePicker:`

  Should return the number of images.

### imagePicker:imageForImageNumber:

Asks the data source for a image to show in a preview.

    - (UIImage *)imagePicker:(JPImagePickerController *)picker
            imageForImageNumber:(NSInteger)imageNumber;

##### Parameters

`picker`

  A picker-object requesting the image.

`imageNumber`

  A image number locating the image in the picker.

##### Discussion

This method should return a UIImage image for the preview at the image number position. The image should have the width of kJPImagePickerControllerPreviewImageWidth and height of kJPImagePickerControllerPreviewImageWidth. If it is not that size the image picker will resize it so it fits.

### imagePicker:thumbnailForImageNumber:

Asks the data source for a thumbnail to insert in a particular location the image picker.

    - (UIImage *)imagePicker:(JPImagePickerController *)picker
            thumbnailForImageNumber:(NSInteger)imageNumber;

##### Parameters

`picker`

  A picker-object requesting the thumbnail.

`imageNumber`

  A image number locating the image in the picker.

##### Discussion

This method should return a UIImage thumbnail for a image at the image number position. The image should have the width of kJPImagePickerControllerThumbnailWidth and height of kJPImagePickerControllerThumbnailWidth. If it is not that size the image picker will resize it so it fits.

### numberOfImagesInImagePicker:

Should return the number of images.

    - (NSInteger)numberOfImagesInImagePicker:(JPImagePickerController *)picker;

##### Parameters

`picker`

  The picker which called this method.

##### Discussion

This method should return the number of images which the picker should display.

Last Updated: Saturday, November 14, 2009