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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:58:02+00:00 2026-05-24T01:58:02+00:00

Why would Bitmap bmp; bmp = Bitmap.createBitmap( 100, 100, Config.RGB_565 ); Ever return a

  • 0

Why would

Bitmap bmp;
bmp = Bitmap.createBitmap( 100, 100, Config.RGB_565 );

Ever return a bitmap with a height and width of -1? I don’t see anything in the documentation about this. Only see this in the documentation

Throws

IllegalArgumentException if the width or height are <= 0

But while debugging in eclipse I see the width and height are -1 after creation. Everything seems to display correctly.

[Update]

If I add a Log and get the width and height

Log.i(logTag, "bmp - (width,height) (" + bmp.getWidth() + "," + bmp.getHeight() + ")");

Then look at the properties of the bitmap, the correct width and height are shown (I’m assuming any call to read the width and height after creation would then update the properties in eclipse and it will show correctly).

I guess this is just a debugger issue? I’m debugging on my old Droid.

  • 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-24T01:58:04+00:00Added an answer on May 24, 2026 at 1:58 am

    Are you in a situation where this is an issue? Or merely curious why they are -1?

    Either way it is not a debugger issue, the properties are actually -1. This is just speculation but until the Bitmap is used/drawn the width and height can be -1 because it doesn’t matter and is likely an optimization in the implementation.

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

Sidebar

Related Questions

Either of these options would be fabulous: Send a bitmap image of the stage's
What's the easiest way to generate a bitmap using Python? Text support would be
I'm trying to figure out a way to create a zero-width, zero-height image which
How do I copy a buffer that would save to a ".BMP" file to
I have a Windows C++ program which receives and saves bitmap files (*.bmp). My
I would like to load an image from a directory ../MyAppFolder/Logos. My code: Bitmap
No matter what I try, I cannot set the width and height of my
I found this method: Graphics g = e.Graphics; Bitmap bmp = new Bitmap(winter.jpg); g.DrawImage(bmp,
How would I go about rotating a Bitmap in Windows GDI,C++?
I would like to convert an instance of Bitmap to an instance of ByteArray

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.