繼承:AFHTTPResponseSerializer:NSObject
聲明處:AFURLResponseSerialization.h
概述
AFImageResponseSerializer是AFHTTPResponseSerializer的子類,驗證和解碼圖片響應(yīng)。
默認(rèn)情況下,AFImageResponseSerializer接受一下MIME類型,與UIImage或NSImage支出的圖像格式相對應(yīng):
- image/tiff
- image/jpeg
- image/gif
- image/png
- image/ico
- image/x-icon
- image/bmp
- image/x-bmp
- image/x-xbitmap
- image/x-win-bitmap
任務(wù)
- imageScale 屬性
- automaticallyInflatesResponseImage 屬性
屬性
automaticallyInflatesResponseImage
@property (nonatomic, assign) BOOL automaticallyInflatesResponseImage
討論
是否自動為壓縮格式(比如PNG或JPEG)膨脹響應(yīng)圖像數(shù)據(jù)。在iOS上當(dāng)使用setCompletionBlockWithSuccess:failure:時啟用這個功能可以顯著提高繪圖性能,同時它允許在后臺而不是在主線程構(gòu)造位圖表示。 默認(rèn)值為YES。
聲明處
AFURLResponseSerialization.h
imageScale
@property (nonatomic, assign) CGFloat imageScale
討論
比例因數(shù)在解釋圖像數(shù)據(jù)構(gòu)造responseImage時使用。指定比例因素為1.0結(jié)果為一個圖片的大小與圖片的像素化緯度相匹配。提供一個不同的比例因素來改變圖片的大小,同時根據(jù)大小數(shù)據(jù)。默認(rèn)設(shè)置為屏幕的比例值,比如自動的為視網(wǎng)膜屏幕縮減圖片。
聲明處
AFURLResponseSerialization.h
// END