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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:29:56+00:00 2026-05-26T22:29:56+00:00

Hello I was just writing a little Android application which takes an image from

  • 0

Hello I was just writing a little Android application which takes an image from the camera und was wondering what the camera Parameter Method setPictureFormat() actually does and what influence it has. As far as I know camera.takePicture() actually only provides data in the JPEG callback. So I would think that data array that arrives in onPictureTaken() is a JPEG data anyway? So why should I set this parameter to PixelFormat.RGB_565 for example? And is there any way to directly interpret the data array directly in onPictureTaken() whithout for example BitmapFactory.decodeByteArray? What I find rather strange is that I have an resulting Image with a resolution of 2448*3264 corresponds to a total of 7990272 pixels. However the underlying data aray that created this image only has a length of about 2000000 pixel. If anyone could clarify that for me it would be much appreciated.

  • 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-26T22:29:56+00:00Added an answer on May 26, 2026 at 10:29 pm

    The setPictureFormat() method applies the pixel format for the bytes arrays returned in the raw and postView callbacks that you pass to takePicture(). As the docs mention, these callbacks MAY not even happen on hardware that doesn’t have the buffers to support it, but if they do happen, the data will be formatted according to this setting. You are correct that the JPEG callback passes data back already compressed into the JPEG format.

    In your example, the size of the raw byte array would vary based on the selected pixel format. You are right, that 2448 * 3264 = 7,990,272 pixels, but each pixel is represented by a number of bytes in the array. For example, formats like NV16 or RGB_565 have 16 bits (2 bytes) to represent each pixel. This means the actual raw byte array length would be 15,980,554 (~15MB), which is a very large amount of data to store in memory at once (that’s almost the entire heap size of the original G1). This is why not all devices buffer and return the raw image data.

    When you inspect the length of the data returned in the JPEG callback, you are looking at the compressed JPEG image data, which is no longer a raw bitmapped image. For this reason, the result will be much smaller. If you were to inflate this JPEG image data back into a Bitmap (using BitmapFactory, for instance) the size would balloon again. Keep this in mind, as an image that size, loaded into memory as an ARGB_8888 Bitmap (4 bytes per pixel) would consume ~32MB. That’s an easy road towards an OutOfMemoryException in your code.

    Hope that Helps!

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

Sidebar

Related Questions

I just create a app for writing the text on Screen using TouchEvent method.
hey guys I'm just writing a name getter app as I'm learning android and
I just started writing a small application in C++ using Visual Studio C++ 2008
I'm practising with C, writing simple programs. The little program below should just get
Hello internet techno-persons, I am writing a project for users to create documents from
Hello everyone I was just going trough http://static.springsource.org/docs/Spring-MVC-step-by-step/part1.html spring tutorial, and I thought its
Hello guys. I think it isn't possible just using PHP, but just to be
I just installed Ubuntu 8.04 and Eclipse. I made a very simple Hello World
Just a blackout, I want the String hello hallo tjena hej tere to an
I'm just starting with Adobe Flex on linux, and can't get the hello world

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.