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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:48:18+00:00 2026-06-02T23:48:18+00:00

I am trying to make a composite image from a camera preview and an

  • 0

I am trying to make a composite image from a camera preview and an ImageView that was above it. I have one image that is a transparent png which is set on an imageview like this

ImageView iv = new ImageView(this);
iv.setImageResource(R.drawable.one);

I then add it to the framelayout which is already showing my camera preview (inherits SurfaceView) like so:

preview = (FrameLayout) findViewById(R.id.camera_preview);
preview.addView(cp); //cp is a reference to a camera preview object
preview.addView(iv);

My imageview’s picture is this:

enter image description here

And the screen is something like this (I had to take a the pic from another camera since the DDMS screenshot wasn’t showing the preview only the image and a black screen, don’t know if that’s a relevant though):

enter image description here

Now my task is to take that picture with the imageview. I came up with two approaches, both of which I do not know whether they can or cannot be implemented

  1. Save the picture seperately, keep track of which cover was on the image and then merge someway. Can this be done, and how?
  2. Gain the look of the framelayout in which both Views are residing and save as image
  3. Take screenshot of a specific area, I will onky do this one as a last resort i.e. if this can be done

What I want to know is which one these approaches is possible and how can it be done? or is there a better way to get this done?

  • 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-02T23:48:19+00:00Added an answer on June 2, 2026 at 11:48 pm

    Assuming you already have image in form of byte[] data from jpeg callback.

    1. Decode the image into a mutable bitmap:

      Bitmap photo = BitmapFactory.decodeByteArray(data, 0, data.length);
      photo = photo.copy(photo.getConfig(), true);
      
    2. Read the overlay:

      Bitmap overlay = BitmapFactory.decodeResource(getResources(), R.drawable.one);
      
    3. Draw overlay on the photo:

      Canvas canvas = new Canvas(photo);
      canvas.drawBitmap(overlay, new Matrix(), null);
      

    Now, photo should contain your image.

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

Sidebar

Related Questions

Trying to make simple minesweeper game in python, but have one problem. I have
Trying to make a custom :confirm message for a rails form that returns data
trying to make a page which will recursively call a function until a limit
Trying to make a toggle button that hides/shows the right window/pane. Here is a
I've got a bunch of tiles that make up a single image, that are
I'm trying to make a box that allows you to select some variables, and
I am trying to make a simple composite control - just a label and
Im using the Prism/Composite Application Library and trying to unit test some code that
I am using a legacy database which does a couple things that make sense
I'm trying make some stuff in jQuery using ASP.NET. But the ID from runat=server

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.