开发者

image size reduced after editing

i created a new image by combining two images. but the size of the final is image is reduced to the size(resolution) of the screen. the code used is

    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); 

after this i am storing the image as

     OutputStream os = null;
     os = new FileOutputStream("/sdcard/DCIM/Camera/" + "myNewFileName5.png");
     out1.compress(CompressFormat.PNG, 100, os);
    开发者_开发百科 os.flush();
     os.close();

dimension of image is staic 640x480. but my final image is 320x240, which is my phones screen resolution. is it because i use Canvas? is there any way to do this without changing the image sizes?


Check your API version? There's an explanation at In the onDraw() method, why does the supplied Canvas already have scale? that for an API level lower than 4 the canvas has a default scaled compatibility mode as if it were targeting a G1 screen.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜