當前位置: 首頁>>代碼示例>>Java>>正文


Java ImageScaleType.EXACTLY_STRETCHED屬性代碼示例

本文整理匯總了Java中com.nostra13.universalimageloader.core.assist.ImageScaleType.EXACTLY_STRETCHED屬性的典型用法代碼示例。如果您正苦於以下問題:Java ImageScaleType.EXACTLY_STRETCHED屬性的具體用法?Java ImageScaleType.EXACTLY_STRETCHED怎麽用?Java ImageScaleType.EXACTLY_STRETCHED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.nostra13.universalimageloader.core.assist.ImageScaleType的用法示例。


在下文中一共展示了ImageScaleType.EXACTLY_STRETCHED屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: considerExactScaleAndOrientatiton

protected Bitmap considerExactScaleAndOrientatiton(Bitmap subsampledBitmap, ImageDecodingInfo decodingInfo,
		int rotation, boolean flipHorizontal) {
	Matrix m = new Matrix();
	// Scale to exact size if need
	ImageScaleType scaleType = decodingInfo.getImageScaleType();
	if (scaleType == ImageScaleType.EXACTLY || scaleType == ImageScaleType.EXACTLY_STRETCHED) {
		ImageSize srcSize = new ImageSize(subsampledBitmap.getWidth(), subsampledBitmap.getHeight(), rotation);
		float scale = ImageSizeUtils.computeImageScale(srcSize, decodingInfo.getTargetSize(), decodingInfo
				.getViewScaleType(), scaleType == ImageScaleType.EXACTLY_STRETCHED);
		if (Float.compare(scale, 1f) != 0) {
			m.setScale(scale, scale);

			if (loggingEnabled) {
				L.d(LOG_SCALE_IMAGE, srcSize, srcSize.scale(scale), scale, decodingInfo.getImageKey());
			}
		}
	}
	// Flip bitmap if need
	if (flipHorizontal) {
		m.postScale(-1, 1);

		if (loggingEnabled) L.d(LOG_FLIP_IMAGE, decodingInfo.getImageKey());
	}
	// Rotate bitmap if need
	if (rotation != 0) {
		m.postRotate(rotation);

		if (loggingEnabled) L.d(LOG_ROTATE_IMAGE, rotation, decodingInfo.getImageKey());
	}

	Bitmap finalBitmap = Bitmap.createBitmap(subsampledBitmap, 0, 0, subsampledBitmap.getWidth(), subsampledBitmap
			.getHeight(), m, true);
	if (finalBitmap != subsampledBitmap) {
		subsampledBitmap.recycle();
	}
	return finalBitmap;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:37,代碼來源:BaseImageDecoder.java

示例2: considerExactScaleAndOrientatiton

protected Bitmap considerExactScaleAndOrientatiton(Bitmap subsampledBitmap, ImageDecodingInfo decodingInfo, int rotation, boolean flipHorizontal) {
    Matrix m = new Matrix();
    ImageScaleType scaleType = decodingInfo.getImageScaleType();
    if (scaleType == ImageScaleType.EXACTLY || scaleType == ImageScaleType.EXACTLY_STRETCHED) {
        float scale = ImageSizeUtils.computeImageScale(new ImageSize(subsampledBitmap.getWidth(), subsampledBitmap.getHeight(), rotation), decodingInfo.getTargetSize(), decodingInfo.getViewScaleType(), scaleType == ImageScaleType.EXACTLY_STRETCHED);
        if (Float.compare(scale, 1.0f) != 0) {
            m.setScale(scale, scale);
            if (this.loggingEnabled) {
                L.d(LOG_SCALE_IMAGE, srcSize, srcSize.scale(scale), Float.valueOf(scale), decodingInfo.getImageKey());
            }
        }
    }
    if (flipHorizontal) {
        m.postScale(-1.0f, 1.0f);
        if (this.loggingEnabled) {
            L.d(LOG_FLIP_IMAGE, decodingInfo.getImageKey());
        }
    }
    if (rotation != 0) {
        m.postRotate((float) rotation);
        if (this.loggingEnabled) {
            L.d(LOG_ROTATE_IMAGE, Integer.valueOf(rotation), decodingInfo.getImageKey());
        }
    }
    Bitmap finalBitmap = Bitmap.createBitmap(subsampledBitmap, 0, 0, subsampledBitmap.getWidth(), subsampledBitmap.getHeight(), m, true);
    if (finalBitmap != subsampledBitmap) {
        subsampledBitmap.recycle();
    }
    return finalBitmap;
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:30,代碼來源:BaseImageDecoder.java

示例3: considerExactScaleAndOrientatiton

protected Bitmap considerExactScaleAndOrientatiton(Bitmap subsampledBitmap, ImageDecodingInfo
        decodingInfo, int rotation, boolean flipHorizontal) {
    Matrix m = new Matrix();
    ImageScaleType scaleType = decodingInfo.getImageScaleType();
    if (scaleType == ImageScaleType.EXACTLY || scaleType == ImageScaleType.EXACTLY_STRETCHED) {
        float scale = ImageSizeUtils.computeImageScale(new ImageSize(subsampledBitmap
                .getWidth(), subsampledBitmap.getHeight(), rotation), decodingInfo
                .getTargetSize(), decodingInfo.getViewScaleType(), scaleType ==
                ImageScaleType.EXACTLY_STRETCHED);
        if (Float.compare(scale, 1.0f) != 0) {
            m.setScale(scale, scale);
            if (this.loggingEnabled) {
                L.d(LOG_SCALE_IMAGE, srcSize, srcSize.scale(scale), Float.valueOf(scale),
                        decodingInfo.getImageKey());
            }
        }
    }
    if (flipHorizontal) {
        m.postScale(-1.0f, 1.0f);
        if (this.loggingEnabled) {
            L.d(LOG_FLIP_IMAGE, decodingInfo.getImageKey());
        }
    }
    if (rotation != 0) {
        m.postRotate((float) rotation);
        if (this.loggingEnabled) {
            L.d(LOG_ROTATE_IMAGE, Integer.valueOf(rotation), decodingInfo.getImageKey());
        }
    }
    Bitmap finalBitmap = Bitmap.createBitmap(subsampledBitmap, 0, 0, subsampledBitmap
            .getWidth(), subsampledBitmap.getHeight(), m, true);
    if (finalBitmap != subsampledBitmap) {
        subsampledBitmap.recycle();
    }
    return finalBitmap;
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:36,代碼來源:BaseImageDecoder.java

示例4: considerExactScaleAndOrientatiton

protected Bitmap considerExactScaleAndOrientatiton(Bitmap subsampledBitmap, ImageDecodingInfo decodingInfo,
                                                   int rotation, boolean flipHorizontal) {
    Matrix m = new Matrix();
    // Scale to exact size if need
    ImageScaleType scaleType = decodingInfo.getImageScaleType();
    if (scaleType == ImageScaleType.EXACTLY || scaleType == ImageScaleType.EXACTLY_STRETCHED) {
        ImageSize srcSize = new ImageSize(subsampledBitmap.getWidth(), subsampledBitmap.getHeight(), rotation);
        float scale = ImageSizeUtils.computeImageScale(srcSize, decodingInfo.getTargetSize(), decodingInfo
                .getViewScaleType(), scaleType == ImageScaleType.EXACTLY_STRETCHED);
        if (Float.compare(scale, 1f) != 0) {
            m.setScale(scale, scale);

            if (loggingEnabled) {
                L.d(LOG_SCALE_IMAGE, srcSize, srcSize.scale(scale), scale, decodingInfo.getImageKey());
            }
        }
    }
    // Flip bitmap if need
    if (flipHorizontal) {
        m.postScale(-1, 1);

        if (loggingEnabled) L.d(LOG_FLIP_IMAGE, decodingInfo.getImageKey());
    }
    // Rotate bitmap if need
    if (rotation != 0) {
        m.postRotate(rotation);

        if (loggingEnabled) L.d(LOG_ROTATE_IMAGE, rotation, decodingInfo.getImageKey());
    }

    Bitmap finalBitmap = Bitmap.createBitmap(subsampledBitmap, 0, 0, subsampledBitmap.getWidth(), subsampledBitmap
            .getHeight(), m, true);
    if (finalBitmap != subsampledBitmap) {
        subsampledBitmap.recycle();
    }
    return finalBitmap;
}
 
開發者ID:jianliaoim,項目名稱:talk-android,代碼行數:37,代碼來源:DiskDecoder.java


注:本文中的com.nostra13.universalimageloader.core.assist.ImageScaleType.EXACTLY_STRETCHED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。