当前位置: 首页>>代码示例>>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;未经允许,请勿转载。