本文整理匯總了Java中android.support.graphics.drawable.VectorDrawableCompat.setBounds方法的典型用法代碼示例。如果您正苦於以下問題:Java VectorDrawableCompat.setBounds方法的具體用法?Java VectorDrawableCompat.setBounds怎麽用?Java VectorDrawableCompat.setBounds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.graphics.drawable.VectorDrawableCompat
的用法示例。
在下文中一共展示了VectorDrawableCompat.setBounds方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getBitmap
import android.support.graphics.drawable.VectorDrawableCompat; //導入方法依賴的package包/類
private static Bitmap getBitmap(VectorDrawableCompat vectorDrawable) {
Bitmap bitmap = Bitmap.createBitmap(vectorDrawable.getIntrinsicWidth(),
vectorDrawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
vectorDrawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
vectorDrawable.draw(canvas);
return bitmap;
}
示例2: getVector2Bitmap
import android.support.graphics.drawable.VectorDrawableCompat; //導入方法依賴的package包/類
public static Bitmap getVector2Bitmap(Context context, int id) {
VectorDrawableCompat vectorDrawable = VectorDrawableCompat.create(context.getResources(), id, context.getTheme());
Bitmap bitmap = Bitmap.createBitmap(vectorDrawable.getIntrinsicWidth(),
vectorDrawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
vectorDrawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
vectorDrawable.draw(canvas);
return bitmap;
}
示例3: getBitmap
import android.support.graphics.drawable.VectorDrawableCompat; //導入方法依賴的package包/類
private static Bitmap getBitmap(VectorDrawableCompat vectorDrawable, int width, int height) {
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
vectorDrawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
vectorDrawable.draw(canvas);
return bitmap;
}
示例4: getBitmap
import android.support.graphics.drawable.VectorDrawableCompat; //導入方法依賴的package包/類
private Bitmap getBitmap(int resource) {
VectorDrawableCompat drawable = VectorDrawableCompat.create(mContext.getResources(), resource, null);
if (drawable != null) {
Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
return bitmap;
} else {
return null;
}
}
示例5: createBitmap
import android.support.graphics.drawable.VectorDrawableCompat; //導入方法依賴的package包/類
private static Bitmap createBitmap(VectorDrawableCompat vectorDrawable) {
Bitmap bitmap = Bitmap.createBitmap(vectorDrawable.getIntrinsicWidth(),
vectorDrawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
vectorDrawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
vectorDrawable.draw(canvas);
return bitmap;
}
示例6: getBitmap
import android.support.graphics.drawable.VectorDrawableCompat; //導入方法依賴的package包/類
private static Bitmap getBitmap(Context context, int resource) {
VectorDrawableCompat drawable = VectorDrawableCompat.create(context.getResources(), resource, null);
if (drawable != null) {
Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
return bitmap;
} else {
return null;
}
}