我有一个可缩放的矢量对象。由于你不能裁剪它(或者因为ICS强制启用了硬件加速而无法裁剪),因此精灵动画就无用了。
我试图将可缩放的对象转换为具有特定大小的位图(最好是屏幕纵横比的百分比)。
当然,这个版本需要超级内存效率。
我需要帮助创建具有特定大小的位图,以下是我目前所拥有的:
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;
}