【发布时间】:2014-06-14 07:31:49
【问题描述】:
我在我的画布上绘制了一个位图,但它没有以原始大小显示
http://upload.dinhosting.fr/A/e/3/Sans_titre.png
这是我的代码:
ImageView image = (ImageView) findViewById(R.id.imageView);
Bitmap bmp1 = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
Bitmap bmp = Bitmap.createBitmap(320, 382, Bitmap.Config.ARGB_8888);
SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.carte);
Canvas canv = new Canvas(bmp);
canv.drawBitmap(bmp1,10,10,null);
Drawable[] layers = new Drawable[2];
layers[0] = svg.createPictureDrawable();
BitmapDrawable drawable = new BitmapDrawable(getResources(), bmp);
layers[1] = drawable;
LayerDrawable layerDrawable = new LayerDrawable(layers);
image.setImageDrawable(layerDrawable);
thnx
【问题讨论】: