| AndBase开发框架 1.6

- 首页
- 相关页面
- 命名空间
- 类
- 文件

- 类列表
- 类索引
- 类继承关系
- 类成员

全部 类 命名空间 文件 函数 变量 枚举值 页
Public 成员函数 | Protected 成员函数 | 静态包函数 | Private 成员函数 | 静态 Private 成员函数 | Private 属性 | 静态 Private 属性 | 所有成员列表
com.ab.image.toolbox.ImageRequest类 参考
类 com.ab.image.toolbox.ImageRequest 继承关系图:

## Public 成员函数
| ImageRequest (String url, Response.Listener< Bitmap > listener, int maxWidth, int maxHeight, Config decodeConfig, Response.ErrorListener errorListener)
Priority | getPriority ()

## Protected 成员函数
Response< Bitmap > | parseNetworkResponse (NetworkResponse response)
void | deliverResponse (Bitmap response)

## 静态包函数
static int | findBestSampleSize (int actualWidth, int actualHeight, int desiredWidth, int desiredHeight)

## Private 成员函数
Response< Bitmap > | doParse (NetworkResponse response)

## 静态 Private 成员函数
static int | getResizedDimension (int maxPrimary, int maxSecondary, int actualPrimary, int actualSecondary)

## Private 属性
final Response.Listener< Bitmap > | mListener
final Config | mDecodeConfig
final int | mMaxWidth
final int | mMaxHeight

## 静态 Private 属性
static final int | IMAGE_TIMEOUT_MS = 1000
static final int | IMAGE_MAX_RETRIES = 2
static final float | IMAGE_BACKOFF_MULT = 2f
static final Object | sDecodeLock = new Object()

## 详细描述

A canned request for getting an image at a given URL and calling back with a decoded Bitmap.

## 构造及析构函数说明

com.ab.image.toolbox.ImageRequest.ImageRequest | ( | String | url,
|  | Response.Listener< Bitmap > | listener,
|  | int | maxWidth,
|  | int | maxHeight,
|  | Config | decodeConfig,
|  | Response.ErrorListener | errorListener
| ) |  |
| inline

Creates a new image request, decoding to a maximum specified width and height. If both width and height are zero, the image will be decoded to its natural size. If one of the two is nonzero, that dimension will be clamped and the other one will be set to preserve the image's aspect ratio. If both width and height are nonzero, the image will be decoded to be fit in the rectangle of dimensions width x height while keeping its aspect ratio.

参数

  url | URL of the image
  listener | Listener to receive the decoded bitmap
  maxWidth | Maximum width to decode this bitmap to, or zero for none
  maxHeight | Maximum height to decode this bitmap to, or zero for none
  decodeConfig | Format to decode the bitmap to
  errorListener | Error listener, or null to ignore errors

## 成员函数说明

void com.ab.image.toolbox.ImageRequest.deliverResponse | ( | Bitmap | response | ) |
| inline protected

Response<Bitmap> com.ab.image.toolbox.ImageRequest.doParse | ( | NetworkResponse | response | ) |
| inline private

The real guts of parseNetworkResponse. Broken out for readability.

static int com.ab.image.toolbox.ImageRequest.findBestSampleSize | ( | int | actualWidth,
|  | int | actualHeight,
|  | int | desiredWidth,
|  | int | desiredHeight
| ) |  |
| inline static package

Returns the largest power-of-two divisor for use in downscaling a bitmap that will not result in the scaling past the desired dimensions.

参数

  actualWidth | Actual width of the bitmap
  actualHeight | Actual height of the bitmap
  desiredWidth | Desired width of the bitmap
  desiredHeight | Desired height of the bitmap

Priority com.ab.image.toolbox.ImageRequest.getPriority | ( |  | ) |
| inline

static int com.ab.image.toolbox.ImageRequest.getResizedDimension | ( | int | maxPrimary,
|  | int | maxSecondary,
|  | int | actualPrimary,
|  | int | actualSecondary
| ) |  |
| inline static private

Scales one side of a rectangle to fit aspect ratio.

参数

  maxPrimary | Maximum size of the primary dimension (i.e. width for max width), or zero to maintain aspect ratio with secondary dimension
  maxSecondary | Maximum size of the secondary dimension, or zero to maintain aspect ratio with primary dimension
  actualPrimary | Actual size of the primary dimension
  actualSecondary | Actual size of the secondary dimension

Response<Bitmap> com.ab.image.toolbox.ImageRequest.parseNetworkResponse | ( | NetworkResponse | response | ) |
| inline protected

## 类成员变量说明

final float com.ab.image.toolbox.ImageRequest.IMAGE_BACKOFF_MULT = 2f
| static private

Default backoff multiplier for image requests

final int com.ab.image.toolbox.ImageRequest.IMAGE_MAX_RETRIES = 2
| static private

Default number of retries for image requests

final int com.ab.image.toolbox.ImageRequest.IMAGE_TIMEOUT_MS = 1000
| static private

Socket timeout in milliseconds for image requests

final Config com.ab.image.toolbox.ImageRequest.mDecodeConfig
| private

final Response.Listener<Bitmap> com.ab.image.toolbox.ImageRequest.mListener
| private

final int com.ab.image.toolbox.ImageRequest.mMaxHeight
| private

final int com.ab.image.toolbox.ImageRequest.mMaxWidth
| private

final Object com.ab.image.toolbox.ImageRequest.sDecodeLock = new Object()
| static private

Decoding lock so that we don't decode more than one image at a time (to avoid OOM's)

该类的文档由以下文件生成:

- src/com/ab/image/toolbox/ImageRequest.java