37 lines
993 B
Java
37 lines
993 B
Java
package com.ubt.jimu.controller.util;
|
|
|
|
import android.content.Context;
|
|
import android.graphics.Bitmap;
|
|
import android.graphics.Canvas;
|
|
import android.graphics.drawable.Drawable;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class SvgUtils {
|
|
private static SvgUtils b;
|
|
private Context a;
|
|
|
|
private SvgUtils(Context context) {
|
|
this.a = context;
|
|
}
|
|
|
|
public static SvgUtils a(Context context) {
|
|
if (b == null) {
|
|
b = new SvgUtils(context);
|
|
}
|
|
return b;
|
|
}
|
|
|
|
public Drawable a(int i) {
|
|
return this.a.getResources().getDrawable(i, this.a.getTheme());
|
|
}
|
|
|
|
public Bitmap a(int i, int i2, int i3) {
|
|
Drawable drawable = this.a.getResources().getDrawable(i, this.a.getTheme());
|
|
Bitmap createBitmap = Bitmap.createBitmap(i2, i3, Bitmap.Config.ARGB_8888);
|
|
Canvas canvas = new Canvas(createBitmap);
|
|
drawable.setBounds(0, 0, i2, i3);
|
|
drawable.draw(canvas);
|
|
return createBitmap;
|
|
}
|
|
}
|