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

The Archive Base Latest Questions

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

I am making the following call in my blackberry application (API ver 4.5)… public

  • 0

I am making the following call in my blackberry application (API ver 4.5)…

public void annotate(String msg, EncodedImage ei)
{
  Bitmap bitmap = ei.getBitmap();

  Graphics g = new Graphics(bitmap);
  g.drawText(msg,0,0);
}

And I keep getting an IllegalArgumentException when I instantiate the Graphics object. Looking at the documentation for Graphics is confusing as it leaves many things unstated.

What does it mean by ‘default type of the device’?
How do you know if the type of ‘bitmap’ is not supported? Does this mean that there are different types of bitmaps? Can different encodedImages generate different types of bitmaps?

Is there another way to add my string to the associated encoded image?

public Graphics(Bitmap bitmap)

Constructs a Graphics object for drawing to a bitmap.

Parameters:

bitmap – Bitmap to draw into. Must be Bitmap.COLUMNWISE_MONOCHROME or the default type of the device.

Throws:

IllegalArgumentException – If the type of ‘bitmap’ is not supported, or the bitmap is readonly.

  • 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-13T07:02:25+00:00Added an answer on May 13, 2026 at 7:02 am

    Are you sure that your Bitmap is mutable? You can’t create Graphics objects from immutable Bitmaps. That is one cause of an IllegalArgumentException. You can set the decode mode for your EncodedImage (EncodeImage.setDecodeMode). There are different modes that allow you to specify whether the file is native or readonly…along with other modes that can be combined.

    The size of the bitmap might be another IllegalArgumentException. Of course, this is relevant to the target device.

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

Sidebar

Related Questions

I'm making an ajax call to a rest API and specified the following header
I have the following setup: Intranet Application --> Call WCF Web Api --> Calls
I am making the following request as a userless API call: https://api.foursquare.com/v2/venues/xxx123yyy/photos?v=20120321&group=venue but the
I am making the following call to an extension method: database.ExecuteScalar(command).NoNull<string>(string.Empty); I get an
I am successfully making an http POST call using the following code: std::string curlString;
I'm making the following call: cupsGetDest(0,0,numDests,dests); Where numDests and dests are set appropriately. null
I'm wondering how i would go about making the following application: a user signs
I am making the following call in my web page: <div id=comments> <fieldset> <h4>
When making an ajax call, when contentType is set to application/json instead of the
I'm making FQL calls using the following url and then making a curl call.

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.