Android ImageView.ScaleType - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ImageView.ScaleType class.

This code example shows how to use the following methods: ordinal
 * Simplify {@linkplain ScaleType ImageView's scale type} to 2 types: {@link #FIT_INSIDE} and {@link #CROP} 
 * 
 * @author Sergey Tarasevich (nostra13[at]gmail[dot]com) 
 * @since 1.6.1 
 */ 
public enum ViewScaleType { 
	/** 
	 * Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the 
	 * image will be equal to or less the corresponding dimension of the view. 
	 */ 
	FIT_INSIDE,
	/** 
	 * Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the 
	 * image will be equal to or larger than the corresponding dimension of the view. 
	 */ 
	CROP;
 
	/** 
	 * Defines scale type of ImageView. 
	 * 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: ordinal
This code example shows how to use the following methods: toString
		setMatrix(); 
	} 
 
	@Override 
	public void draw(Canvas canvas) {
		Log.w(TAG, "Draw: " + mScaleType.toString());
		if (mBorderWidth > 0) {
			canvas.drawRoundRect(mBorderRect, mCornerRadius, mCornerRadius, mBorderPaint);
			canvas.drawRoundRect(mDrawableRect, Math.max(mCornerRadius - mBorderWidth, 0), Math.max(mCornerRadius - mBorderWidth, 0), mBitmapPaint);
		} else { 
			canvas.drawRoundRect(mDrawableRect, mCornerRadius, mCornerRadius, mBitmapPaint);
		} 
	} 
 
	@Override 
	public int getOpacity() { 
		return PixelFormat.TRANSLUCENT;
	} 
 
	@Override 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: ordinal
 * ScaleType values 
 * 
 * @author Cyril Mottier 
 * @author kennydude 
 */ 
public class ScaleImageProcessor implements ImageProcessor { 
 
    private int mWidth;
    private int mHeight;
    private ScaleType mScaleType;
    private final Matrix mMatrix = new Matrix();
 
    private final RectF mTempSrc = new RectF();
    private final RectF mTempDst = new RectF();
 
    /** 
     * Create a new ScaleImageProcessor. 
     * 
     * @param width The width of the final surrounding box 
     * @param height The height of the final surrounding box 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: ordinal
package cm.aptoide.com.nostra13.universalimageloader.core.assist; 
 
import android.widget.ImageView; 
import android.widget.ImageView.ScaleType; 
 
/** 
 * Simplify {@linkplain ScaleType ImageView's scale type} to 2 types: {@link #FIT_INSIDE} and {@link #CROP} 
 *  
 * @author Sergey Tarasevich (nostra13[at]gmail[dot]com) 
 */ 
public enum ViewScaleType { 
	/** 
	 * Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the 
	 * image will be equal to or less the corresponding dimension of the view. 
	 */ 
	FIT_INSIDE,
	/** 
	 * Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the 
	 * image will be equal to or larger than the corresponding dimension of the view. 
	 */ 

4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android ImageView.ScaleType Questions & Answers:

See Code Examples for Android ImageView.ScaleType Methods: