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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:44:16+00:00 2026-05-26T05:44:16+00:00

Possible Duplicate: Android: How to overlay-a-bitmap/draw-over a bitmap? I have implement the android Camera

  • 0

Possible Duplicate:
Android: How to overlay-a-bitmap/draw-over a bitmap?

I have implement the android Camera functionality in amy application.

Now i want to combine any transperent image with that captured camera Image before to save that image in to gallery, then how it can be done ??

Any code will be realy appereciated.
Thanks.

Edit:
I am using this Code to captured and Save the Image So, How shoud i have to Implement Such things.

takePhotoBtn.setOnClickListener(new OnClickListener() {
        public void onClick(View v) { // <5>

            ImageCaptureCallback iccb = null;

            try {
                String filename = timeStampFormat.format(new Date());
                ContentValues values = new ContentValues();
                values.put(Media.TITLE, filename);
                values.put(Media.DESCRIPTION, "Image capture by camera");
                Uri uri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values);

                iccb = new ImageCaptureCallback( getContentResolver().openOutputStream(uri));

                // to put the Image on captured image.
                Canvas canvas = new Canvas();
                Bitmap kangoo = BitmapFactory.decodeResource(getResources(),
                        R.drawable.icon);
                canvas.drawColor(Color.argb(160, 21, 140, 21));
                canvas.drawBitmap(kangoo, 130, 10, null);


            } catch(Exception ex ){
                ex.printStackTrace();
                Log.e(getClass().getSimpleName(), ex.getMessage(), ex);
            }
          camera.takePicture(mShutterCallback, mPictureCallbackRaw, iccb);
        }
      });


Camera.PictureCallback mPictureCallbackRaw = new Camera.PictureCallback() {
    public void onPictureTaken(byte[] data, Camera c) {
        Log.e(getClass().getSimpleName(), "PICTURE CALLBACK RAW: " + data);
            System.out.println("\n\n\n\nThe Data in mPictureCallbackRaw is :"+data);
        //camera.startPreview(); // Added StastPreview();
    }
};

Camera.PictureCallback mPictureCallbackJpeg= new Camera.PictureCallback() {
    public void onPictureTaken(byte[] data, Camera c) {
        Log.e(getClass().getSimpleName(), "PICTURE CALLBACK JPEG: data.length = " + data);
        System.out.println("\n\n\n\nThe Data in mPictureCallbackJPEG is :"+data);
        camera.startPreview();
    }
};

Camera.ShutterCallback mShutterCallback = new Camera.ShutterCallback() {
    public void onShutter() {
        Log.e(getClass().getSimpleName(), "SHUTTER CALLBACK");
    }
};




public class ImageCaptureCallback implements PictureCallback  {

private OutputStream filoutputStream;
public ImageCaptureCallback(OutputStream filoutputStream) {
    this.filoutputStream = filoutputStream;
}
@Override
public void onPictureTaken(byte[] data, Camera camera) {
    try {
        Log.v(getClass().getSimpleName(), "onPictureTaken=" + data + " length = " + data.length);

        filoutputStream.write(data);
        filoutputStream.flush();
        filoutputStream.close();


    } catch(Exception ex) {
        ex.printStackTrace();
    }
}

}

  • 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-05-26T05:44:17+00:00Added an answer on May 26, 2026 at 5:44 am

    Try this to combine the two Bitmaps the Camera Image and Transparent Image. This is combine of the images and store in the SDCard.

    public Bitmap combineImages(Bitmap c, Bitmap s) {
    
            Bitmap cs = null;
            int width, height = 0;
    
            if (c.getWidth() > s.getWidth()) {
                width = c.getWidth();
                height = c.getHeight();
            } else {
                width = s.getWidth() + s.getWidth();
                height = c.getHeight();
            }
    
            cs = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
    
            Canvas comboImage = new Canvas(cs);
    
            comboImage.drawBitmap(c, 0, 0, null);
            comboImage.drawBitmap(s, 100, 300, null);
    
            /******
             * 
             *   Write file to SDCard
             * 
             * ****/
    
            String tmpImg = String.valueOf(System.currentTimeMillis()) + ".png";
            OutputStream os = null;
            try {
                os = new FileOutputStream(Environment.getExternalStorageDirectory()
                        + "/"+tmpImg);
                cs.compress(CompressFormat.PNG, 100, os);
            } catch (IOException e) {
                Log.e("combineImages", "problem combining images", e);
            }
            return cs;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Intent to launch the clock application on android I have a widget
Possible Duplicate: Android: ProgressDialog.show() crashes with getApplicationContext I want to have a progress dialog
Possible Duplicate: Android - Application (apk) Maximum size I want to install an APK
Possible Duplicate: Android, move bitmap along a path? I want to move an image
Possible Duplicate: Lock the Android device programmatically Does the application have the ability to
Possible Duplicate: accelerometer in Android emulator I have an application that plays music when
Possible Duplicate: Android Unknown Command 'crunch' I have been using eclipse just fine but
Possible Duplicate: Implement page curl on android? How to do page flipping/turning or curl
Possible Duplicate: R cannot be resolved - Android error The errors I have are
Possible Duplicate: How to test the performance of an Android application? How can 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.