I have an object object that is a vector. Since you cannot crop (or a clip due to ICS hardware acceleration), it can make sprite animations useless.
I am trying to convert a drawable to a bitmap with a specific size (as a percentage of the lowest screen size for best results).
Of course, the version should be super-memory.
I need help creating a bitmap with a specific size, this is what I got so far:
public Bitmap svgTObitmap(String name, int percentage, int screen_width, int screen_height)
{
_resID = _context.getResources().getIdentifier( name , "raw" , _context.getPackageName());
SVG svg = SVGParser.getSVGFromResource(_context.getResources(), _resID);
Drawable drawable = svg.createPictureDrawable();
Bitmap bmp = ((BitmapDrawable)drawable).getBitmap();
return bmp;
}
source
share