Follow the instructions of svg-android to get PictureDrawable from your SVG file. Then you need to create a Bitmap from the size of the PictureDrawable and pass it to the Canvas . When Canvas now draws a Picture from a PictureDrawable , the current bitmap that you need is drawn (created) at runtime.
PictureDrawable pictureDrawable = svg.createPictureDrawable(); Bitmap bitmap = Bitmap.createBitmap(pictureDrawable.getIntrinsicWidth(), pictureDrawable.getIntrinsicHeight(), Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); canvas.drawPicture(pictureDrawable.getPicture()); currentBitmap = bitmap;
source share