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

  • Home
  • SEARCH
  • 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 8389041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:36:52+00:00 2026-06-09T18:36:52+00:00

I followed another StackOverflow tutorial where you can capture a bitmap from the camera

  • 0

I followed another StackOverflow tutorial where you can capture a bitmap from the camera and set it to your image view. The issue I am having is that the picture that is returned is very small and does not fill the rest of the screen. In my XML I do the following…

<ImageView 
     android:id="@+id/imgview" 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

If I change to “fill_parent” I get a larger image, but my question now is how would I go about getting the actual size image and putting it on a scrollable (in both the x and y directions) view container.

Thanks!

BTW, here is the code for capturing the Bitmap from the camera…

public class MainActivity extends Activity implements OnClickListener
{
private ImageView imageView;

@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Log.d("matt","1");

    Button b = (Button)this.findViewById(R.id.btn);
    imageView = (ImageView)this.findViewById(R.id.imgview);

    b.setOnClickListener(this);
}

@Override
public boolean onCreateOptionsMenu(Menu menu)
{
    getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
}

@Override
public void onClick(View v)
{
    Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
    startActivityForResult(cameraIntent,1888);
}

protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
    if(requestCode == 1888)
    {
        Log.d("matt", "3.a");
        Bitmap photo = (Bitmap) data.getExtras().get("data");
        Log.d("matt", "3.b");
        imageView.setImageBitmap(photo);
        Log.d("matt", "3.c");
    }
}
  • 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-09T18:36:54+00:00Added an answer on June 9, 2026 at 6:36 pm

    If you need the dimensions of the image being captured then you can use:

    int height = photo.getHeight();
    int width = photo.getWidth();
    

    Otherwise, if you would like to find out the size of the image captured (in megabytes) then please refer to my answer to this question: https://stackoverflow.com/a/11846455/1512836

    [EDIT] – Please check this for scrolling an image view: Images in ScrollView in android

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

Sidebar

Related Questions

I'm having a problem inserting a less than sign < followed by another character
I'm trying to do a TextEntryDialog followed by another TextEntryDialog. I can only get
I am executing a program say A from another by first fork-ing followed by
I am trying to sort a list of names followed by another string such
I followed this tutorial . But whenever I try to log in with my
I followed this video tutorial for detecting memory leaks using Instruments with Xcode 4.3.2.
I followed this tutorial to implement facebook into my application. All I want is
I've made a twitter-like web app. Users can follow one another when viewing eachother's
I need to programmely switch the current user to another,then the followed code should
I created a basic application shell with AppFuse, and followed the AppFuse tutorial to

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.