Write contents of custom View to large Image file on SD card
Posted
by JFortney
on Stack Overflow
See other posts from Stack Overflow
or by JFortney
Published on 2010-03-12T19:47:07Z
Indexed on
2010/03/12
19:47 UTC
Read the original article
Hit count: 273
android
I have a class that extends View. I override the onDraw method and allow the user to draw on the screen. I am at the point where I want to save this view as an image. I Can use buildDrawingCache and getDrawingCache to create a bitmap that I can write to the SD card. However, the image is not good quality at a large size, it has jagged edges. Since I have a View and I use Paths I can transform all by drawing to a bigger size. I just don't know how to make the Canvas bigger so when I call getDrawingCache it doesn't crop all the paths I am just transformed. What is happening is I transform all my paths but when I write the Bitmap to file I am only getting the "viewport" of the actual screen size. I want something much bigger. Any help in the right direction would be greatly appreciated. I have been reading the docs and books and am at a loss. Thanks Jon
© Stack Overflow or respective owner