Android Universal-Iamge-Loader的DisplayImageOptions

來源:互聯網
上載者:User

標籤:圖片處理   開源架構   android平台   uil   

現在才知道Android中為了避免OOM,在圖片處理上,可以使用開源架構Universal-Iamge-Loader。本文只是簡單的介紹下其中的DisplayImageOptions的一些方法的含義,如下:

//設定圖片在下載期間顯示的圖片

showStubImage(R.drawable.ic_launcher)

//設定圖片Uri為空白或是錯誤的時候顯示的圖片

showImageForEmptyUri(R.drawable.ic_empty)

/設定圖片載入/解碼過程中錯誤時候顯示的圖片

showImageOnFail(R.drawable.ic_error)

//設定圖片在下載前是否重設,複位

resetViewBeforeLoading()

//設定下載的圖片是否緩衝在記憶體中

cacheInMemory()

//設定下載的圖片是否緩衝在SD卡中

cacheOnDisc()

//設定圖片的解碼類型

bitmapConfig(Bitmap.Config.RGB_565)

//設定圖片的解碼配置

decodingOptions(android.graphics.BitmapFactory.Options decodingOptions)

//設定圖片下載前的延遲

delayBeforeLoading(int delayInMillis)

//設定額外的內容給ImageDownloader

extraForDownloader(Object extra)

//設定圖片加入緩衝前,對bitmap進行設定

preProcessor(BitmapProcessor preProcessor)

//設定顯示前的圖片,顯示後這個圖片一直保留在緩衝中

postProcessor(BitmapProcessor postProcessor)

//設定圖片以如何的編碼方式顯示

imageScaleType(ImageScaleType imageScaleType)


至於具體使用,大家可以自行到網上搜尋文章。

一些參考如下:http://www.eoeandroid.com/thread-333220-1-1.html

http://www.cnblogs.com/kissazi2/p/3901235.html

http://blog.csdn.net/vipzjyno1/article/details/23206387


轉載請註明出處:http://blog.csdn.net/android_jiangjun/article/details/39231439

Android Universal-Iamge-Loader的DisplayImageOptions

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.