0

So I have a basic canvas painting app. I have a background image which acts as a template to which you paint within. I want to be able to save the image and then eventually print it.. either by forwarding it by email or some air printing..

However the issue is this. When I take the image template as it is on my computer and print it, it is fine. 100% scale . But after I save the image within my app before or after adjustments have been made with painting the image it can no longer be printed on one page of A4. It has to be scaled to fit. It's very important that I dont scale to fit it on to a page as it fits fine before android saves it.

I'm guessing it has something to do with dpi or density of android screen or something along these lines.

Here is the code I use to create the bitmap

   templateBackground = BitmapFactory.decodeResource(getResources(),R.drawable.backgroundTemplate);

    Bitmap.Config conf = Bitmap.Config.ARGB_8888;

    bitmap_object = Bitmap.createBitmap(templateBackground.getWidth(),
            templateBackground.getHeight(), conf);
    bitmap_object.setDensity(Bitmap.DENSITY_NONE);

Saving is done with a simple output stream to Private storage

b1.compress(CompressFormat.PNG,100,fo);

If anyone has any ideas that would be great!

Weird thing is the resolution never changes before or after the save on android.. So I just dont understand why when I try to print it the size changes. .

4

0 回答 0