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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:18:42+00:00 2026-06-13T17:18:42+00:00

Im developing a camera app which uses SurfaceView for display. I’m able to take

  • 0

Im developing a camera app which uses SurfaceView for display.

I’m able to take screenshot of the SurfaceView (and save it as a bitmap)
with getDrawingCache() (on a layout which wraps the SurfaceView)
and also with canvas.drawBitmap(…)

however in both ways, the bitmap is always transparent/blank.

I have galaxy S3 and I can see that they have that feature in their camera
how exactly they do it?

thanks!

  • 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-13T17:18:44+00:00Added an answer on June 13, 2026 at 5:18 pm

    Well after hours, I got a nice solution for that.
    Maybe it isn’t the best way, but it is good enough for me.

    private long start;
    private long end;
    private long period;
    

    First get a start time right after the media recorder starts:

    private void startRecording()
    {
       mMediaRecoder.start();
       start = System.currentTimeMillis();
    }
    

    Then, when u press on the screen/button for taking screenshot, save the period:

    private void captureImage()
    {
       end = System.currentTimeMillis();
       period = end - start;
    }
    

    Finally, when you stop recording, get the bitmap using the period and the Media retriever:

    private void saveVideo()
    {
       MediaMetadataRetriever retriever = new MediaMetadataRetriever();
       //path -> the path to the video
       retriever.setDataSource(path);
       Bitmap bitmap = retriever.getFrameAtTime(period * 1000,MediaMetadataRetriever.OPTION_CLOSEST);
    }
    

    Hope it helps you!

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

Sidebar

Related Questions

i am developing a program which uses the android camera to take pictures. but
I'm currently developing an app which uses the built-in Camera. I call this snippet
I am developing an app which uses the phone's default camera application to capture
I am developing an app in which user will take Picture from camera and
I'm developing with SDK 1.6.2. My app uses the camera to capture and save
I am developing a Java ME application which uses the camera to take a
I am developing an Android application in 2.2, which uses Camera. Now Can anyone
I'm developing a JavaFX application which uses a webcam. To be able to access
I am planning on developing an app that uses the camera, uploads pictures to
I am developing an app for iPad2 which allows user to take photos. 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.