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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:43:06+00:00 2026-06-08T22:43:06+00:00

in my application i want to capture screen which is with surfaceview but i

  • 0

in my application i want to capture screen which is with surfaceview but i am not able capture screen on which is drawn with background.how to save the screen with drawn along with background.please help me how to solve this issue.

         View content  = findViewById(R.id.relative21);
        content.setDrawingCacheEnabled(true);

        SurfaceHolder sfhTrack = drawingSurface.getHolder();
              sfhTrack.setFormat(PixelFormat.TRANSPARENT);

               private void getScreen() {
          // TODO Auto-generated method stub

             View content = findViewById(R.id.relative21);
                Bitmap bitmap = content.getDrawingCache();
            File myDir=new File("/sdcard/saved_images");
                myDir.mkdirs();
                Random generator = new Random();
                int n = 10000;
                n = generator.nextInt(n);
                String fname = "Image-"+ n +".png";
                File file = new File (myDir, fname);
                try 
                {

                    FileOutputStream ostream = new FileOutputStream(file);
                    bitmap.compress(CompressFormat.PNG, 100, ostream);
                    ostream.close();
                } 
                catch (Exception e) 
                {
                    e.printStackTrace();
                }
    }

i tried above code i am able to save background but i am not able save which is drawn.

  • 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-08T22:43:08+00:00Added an answer on June 8, 2026 at 10:43 pm
       public static Bitmap overlay(Bitmap bmp1,Bitmap bmp2) {
            Bitmap bmOverlay = Bitmap.createBitmap(bmp1.getWidth(), bmp1.getHeight(),      bmp1.getConfig());
            Canvas canvas = new Canvas(bmOverlay);
            canvas.drawBitmap(bmp1, 0,0, null);
    
            canvas.drawBitmap(bmp2, 0, 0, null);
            Log.i("bmOverlay.......",""+bmOverlay);
            bmp3=bmOverlay;
            return bmOverlay;
        }
    
           private void getScreen() {
            Toast.makeText(BookType1.this, "saved", Toast.LENGTH_SHORT).show();
              File myDir=new File("/sdcard/saved_images");
                myDir.mkdirs();
                Random generator = new Random();
                int n = 10000;
                n = generator.nextInt(n);
                String fname = "Image-"+ n +".png";
                File file = new File (myDir, fname);
    
    
            try 
            {
    
                FileOutputStream ostream = new FileOutputStream(file);
                bmp3.compress(CompressFormat.PNG, 100, ostream);
    
    
                ostream.close();
            } 
            catch (Exception e) 
            {
                e.printStackTrace();
            }
        }
    

    By overlapping two bitmaps i solved this issue in one bitmap i captured background and in second bitmap i captured surface view and i overlapped both in this i got solution.

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

Sidebar

Related Questions

Background: I have an application where I want to be able to capture keyboard
win32 windows application and want to capture full screen and remove the border of
I want to create an application that will enable the users to Capture Screen
I have a application that will capture the screen and I want to write
I want to get a screen capture on the form created by Application.Run(new Form1());
In my application I want to capture image and save it to sdcard. I
This is a Windows application using C#. I want to capture a screen shot
I am creating an application in which I want to capture a image and
I want to capture a screen shot of Android applications that are running on
In my application I want to capture two images using camera and then I

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.