This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I tried posting this question earlier. I do not see it anywhere, so I am giving it another try.
I have been working on program (ReDrawa) to open an image (right now Colors.png, attached), change the color(s), and then save the changed image to the SDcard.
All goes well except for the saving. I have two methods that I have tried with some success.
This saves what I call an empty file. It does not show up in the Gallery. However, when I adb pull /sdcard/out0.png, it pulls out a file with no image (I cannot open the file) it is listed as having 0K.
The second method comes from code I saw on line that saves the R.drawable.icon. When I try to change it to R.id.imageView1 there is no error but again it is an empty file.
In DDMS there is a Null Pointer warning. So I am thinking that I have not connected imageView1 to bmp.
I think that I do want to save to the SD card. But I will certainly give your code a try.
I know about the code at the http://android-er.blogspot.com/2010/07/save-file-to-sd-card.html site. I have seen it
there and elsewhere in my web searches. I had discounted it being a guide for my project because, it loads an image
from the Internet using a URL. Whereas I am loading an image from a SD card (I added to my code an user input file
name). Also it saves the image using the URL (plus I suspected that it saved the web image rather than saving the
rendered image in my imageView).
I went to http://android-er.blogspot.com/2010/07/save-file-to-sd-card.html again and I tried cobbling its save code
into my project. I think I ended up with a hidious hybird. My attempt did not compile. I will put that aside until I try out
the code you suggest. My harddrive appears to be going wonky; it looks as tho I need a new one, so it may be awhile before
I can give it a go.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com