Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7790921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:44:05+00:00 2026-06-01T21:44:05+00:00

In my android app i am saving drawing as image.I am able to save

  • 0

In my android app i am saving drawing as image.I am able to save the file but its not saving 100% perfectly i.e,some contents are missing spaces are coming. The function is below which is i am calling by onclick. Please Help me how to save perfect drawing
for screen shots visit the following links:
http://www.flickr.com/photos/77093196@N03/7066979339,
http://www.flickr.com/photos/77093196@N03/7066979341

DigitalSignatureActivity.java

private DrawingSurface drawingSurface;

    // To save file as Image
        public void saveDrawing(View v) throws IOException {

            File mediaStorageDir = new File(
                    Environment
                            .getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES),
                    "MySignatures");
             Bitmap nBitmap = drawingSurface.getBitmap();
            try {
                if (!mediaStorageDir.exists()) {
                    mediaStorageDir.mkdirs();
                }
                String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss")
                        .format(new Date());
                File mediaFile = new File(mediaStorageDir.getPath()
                        + File.separator + "SIGN_" + timeStamp + ".png");
             FileOutputStream out = new FileOutputStream(mediaFile);

            nBitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
                out.flush();
                out.close();
                Toast.makeText(this, "Signature saved  to " + mediaFile,
                        Toast.LENGTH_LONG).show();
            } catch (Exception e) {
                e.printStackTrace();
                Toast.makeText(getApplicationContext(), "Not saved",
                        Toast.LENGTH_SHORT).show();
            }

        }

DrawingSurface.java

public class DrawingSurface extends SurfaceView implements SurfaceHolder.Callback {
//some code
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:44:06+00:00Added an answer on June 1, 2026 at 9:44 pm

    I solved by setting canvas.drawColor(Color.WHITE, PorterDuff.Mode.DARKEN); in DrawingSurface.java class

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need my Android app to save it's state to disk when its activity
My android app project need to add a new function of saving the click
I'm looking to create a background image for a viewgroup in an Android app,
I built an android app on android 2.2 , for saving files into the
In my app, me downloading different image and saving inside sdcard under a folder.
In my app I save an XML file to the user's SD card by
I wrote a simple file saving system. But it doesn't work. I wrote it
We are making an app on android and iphone. One method is to save
I have a purely native Android NDK app, and need to render some text
My android app has a two word app name, and the 2nd word doesn't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.