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 8039539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:36:11+00:00 2026-06-05T03:36:11+00:00

I am working on a application that will stores a drawn canvas as jpeg

  • 0

I am working on a application that will stores a drawn canvas as jpeg image in SD card.
The issue is when i tried to view the saved image it is loading for lot of time than other images i want the saved image to be viewed in normal time as like other images
My code for saving an image is:

            View content = drawView;
            content.setDrawingCacheEnabled(true);
            content.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_LOW);
            Bitmap bitmap = content.getDrawingCache();

            String path = Environment.getExternalStorageDirectory().getAbsolutePath();
            String file_name="Imatge"+System.currentTimeMillis()+".jpg";
            File file = new File(path,file_name);
            FileOutputStream ostream;
            try {                   
                ostream = new FileOutputStream(file);
                bitmap.compress(CompressFormat.PNG,50, ostream);
                ostream.flush();
                ostream.close();
                Toast.makeText(getApplicationContext(), " :) Image saved in "+ path+"/"+file_name, 5000).show();
            } catch (Exception e) {
                e.printStackTrace();
                Toast.makeText(getApplicationContext(), e.toString()+"error", 5000).show();
            }
                }

Thanks in advance please help me!!!!

  • 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-05T03:36:13+00:00Added an answer on June 5, 2026 at 3:36 am

    I myself find the solution , the solution is to store the image thru media store here is my code that is working correctly

    View content = drawView;
                    content.setDrawingCacheEnabled(true);
                    content.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_AUTO);
                    Bitmap bitmap;
                    bitmap = content.getDrawingCache();             
                    String file_name="MyImage"+System.currentTimeMillis()+".jpg";
    
                    ContentValues values = new ContentValues();
                    values.put(Images.Media.TITLE,"MyImage");                   
                    values.put(Images.Media.DESCRIPTION,"Advanced Practice");                   
                    values.put(Images.Media.MIME_TYPE, "image/jpeg");
                    Uri url = null;
    
                    try 
                    {   
                        url = getContentResolver().insert(MediaStore.Images.Thumbnails.getContentUri("external"), values);
                        MediaStore.Images.Media.insertImage(getContentResolver(), bitmap,"MyImage","Advanced Practice");                     
                        Toast.makeText(getApplicationContext(), " :) Image saved in /sdcard/DCIM/Camera/"+file_name, 5000).show();
                    } 
                    catch (Exception e) 
                    {
                        e.printStackTrace();
                        Toast.makeText(getApplicationContext(), e.toString()+"error", 5000).show();
                    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an application that will have attachments, and I would like to
I am working on an application that will perform a search against an online
I am working on web application that will use PHP & MySQL. Application will
I am currently working on an application that will retrieve other users' locations based
I'm working on a web application that will have a custom UI for the
I'm working on a desktop application that will produce several in-memory datasets as an
We are working on a Vista/Windows 7 application that will be running in 64
I'm working on a Rails 3.2 application that will allow users to authenticate with
I am working on an application at the minute that will originally be just
I am working on making an application that will store information, and for user

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.