iOS系統相簿的有關操作

來源:互聯網
上載者:User

標籤:

  iOS中,我們選擇相簿中的資源和調用網路攝影機可以使用 :UIImagePickerController類來完成,不使用UI我們可以通過:ALAssetsLibrary類來使用相簿資源。

一. ALAssetsLibrary簡介

ALAssetsLibrary提供了訪問了iOS裝置下所有照片和視頻的介面

1. 從ALAssetLibrary中可以讀取所有的相簿資料 用ALAssetsGroup對象列表;

2. 從每個ALAssetsGroup中可擷取到其中包含的照片或視頻列表,即ALAsset對象列表;

3. 每個ALAsset可能有多個representations表示,即ALAssetRepresentation對象,使用其defaultRepresentation方法可獲得其預設representations,使用[asset valueForProperty:ALAssetPropertyRepresentations]可擷取其所有representations的數組。

4. 從ALAsset對象可擷取縮圖thumbnail或aspectRatioThumbnail;

5. 從ALAssetRepresentation對象可擷取全尺寸圖片(fullResolutionImage),全屏圖片 (fullScreenImage)及圖片的各種屬性:orientation,dimensions,scale,url,metadata等。

其層次關係為ALAssetsLibrary ->ALAssetsGroup ->ALAsset ->ALAssetRepresentation.

iOS系統相簿的有關操作

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.