0
我通过组合两个图像创建了一个新图像。但最终的图像尺寸缩小到屏幕的大小(分辨率)。所使用的代码是编辑后图像尺寸减小
Bitmap pic = BitmapFactory.decodeResource(getResources(), R.drawable.me);
Bitmap stat= BitmapFactory.decodeResource(getResources(), R.drawable.static);
Bitmap out1 = Bitmap.createBitmap(stat) ;
Canvas comboImage = new Canvas(out1);
comboImage.drawBitmap(map, 0, 0, null);
comboImage.drawBitmap(pic, 150f, 30f, null);
后这个我存储图像作为图像的
OutputStream os = null;
os = new FileOutputStream("/sdcard/DCIM/Camera/" + "myNewFileName5.png");
out1.compress(CompressFormat.PNG, 100, os);
os.flush();
os.close();
尺寸为640×480 staic。但我的最终形象是320x240,这是我的手机屏幕分辨率。是因为我使用Canvas吗?有没有办法做到这一点,而不改变图像大小?
使用的API版本是7 – sandeep 2011-06-10 08:11:59