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


Java VectorDrawableCompat.draw方法代碼示例

本文整理匯總了Java中android.support.graphics.drawable.VectorDrawableCompat.draw方法的典型用法代碼示例。如果您正苦於以下問題:Java VectorDrawableCompat.draw方法的具體用法?Java VectorDrawableCompat.draw怎麽用?Java VectorDrawableCompat.draw使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.graphics.drawable.VectorDrawableCompat的用法示例。


在下文中一共展示了VectorDrawableCompat.draw方法的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;
}
 
開發者ID:Jhuku,項目名稱:TriangularCustomView,代碼行數:9,代碼來源:IndicatorView.java

示例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;
}
 
開發者ID:kranthi0987,項目名稱:easyfilemanager,代碼行數:10,代碼來源:Utils.java

示例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;
}
 
開發者ID:mangoblogger,項目名稱:MangoBloggerAndroidApp,代碼行數:8,代碼來源:Utils.java

示例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;
    }
}
 
開發者ID:sanjaysingh1990,項目名稱:Exoplayer2Radio,代碼行數:13,代碼來源:ImageHelper.java

示例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;
}
 
開發者ID:sakebook,項目名稱:CustomTabsSample,代碼行數:9,代碼來源:ResourceUtil.java

示例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;
    }
}
 
開發者ID:y20k,項目名稱:trackbook,代碼行數:13,代碼來源:NotificationHelper.java


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