Initial commit
This commit is contained in:
36
sources/com/ubt/jimu/controller/util/SvgUtils.java
Normal file
36
sources/com/ubt/jimu/controller/util/SvgUtils.java
Normal file
@@ -0,0 +1,36 @@
|
||||
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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user