Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am not sure if this is the right forum for asking this question, but I googled "questions related to iPhone" and the first page had SO from top to bottom. So here goes.

When I open the Photos Application in iPhone (3GS, 4 and 5 all running iOS 5.0) and open an image, first a blurred image appears for a fraction of a second, which clears up into the actual picture. My question is, does the Photo application have a low resolution copy of the high res images which it displays while the image is being loaded, OR does it generate a low res image on the fly before going on to load the high res image.

I am writing an application to browse through the photos, and need to know which is the best approach. That is the purpose behind this question.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
140 views
Welcome To Ask or Share your Answers For Others

1 Answer

The best way is using ALAsset thumbnail . If you have concerns with image clarity, then go with ALAsset fullResolutionImage

Here are some details that you must read before going to start developing an photos application.

An instance of ALAssetsLibrary provides access to the videos and photos that are under the control of the Photos application.

An ALAsset object represents a photo or a video managed by the Photo application.

There are different ALAsset Accessing Representations

1.thumbnail

Returns a thumbnail representation of the asset.

- (CGImageRef)thumbnail

2.aspectRatioThumbnail

Returns an aspect ratio thumbnail of the asset.

- (CGImageRef)aspectRatioThumbnail

3.defaultRepresentation

Returns an asset representation object for the default representation.

- (ALAssetRepresentation *)defaultRepresentation

4.representationForUTI:

Returns an an asset representation object for a given representation UTI.

- (ALAssetRepresentation *)representationForUTI:(NSString *)representationUTI

An ALAssetRepresentation object encapsulates one of the representations of a given ALAsset object.

1.CGImageWithOptions:

Returns a full resolution CGImage of the representation.

- (CGImageRef)CGImageWithOptions:(NSDictionary *)options

2.fullResolutionImage

Returns a CGImage representation of the asset.

- (CGImageRef)fullResolutionImage

3.fullScreenImage

Returns a CGImage of the representation that is appropriate for displaying full screen.

- (CGImageRef)fullScreenImage

Sample Code


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...