开发者

Getting thumbnails from photos library

I want to save the thumbnails from the iphone photo library, and i want to use them in my application, but not by selecting them, i want it to work automatically. so i run the开发者_开发知识库 app, and the thumbnails will appear in the middle of the screen in a scrollable tableview. (5 thumbs in each "page"). Like this: http://cl.ly/0z2m261J2I0B461n2L25

what is the best way to do it? Oh , and of course if a user touch a thumnail the large image will appear in a different view.


  1. Create an ALAssetsLibrary instance.
  2. Send a enumerateGroupsWithTypes:usingBlock:failureBlock: message to your assets library object.
  3. In the block, you are passed an ALAssetsGroup instance over which you again iterate with enumerateAssetsUsingBlock:.
  4. In that block, you get an ALAsset that you can then ask for its thumbnail (a CGImageRef) or its representation (an instance of ALAssetRepresentation), which in turn you can get an image to display from.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜