Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 51
Registered: ‎04-19-2009
My Device: Not Specified

What are the restrictions on the bitmap to create a Graphics object from?

[ Edited ]

Hey, all!

 

I'm using BlackBerry Storm 9530 simulator (4.7.0.75 Platform) and JDE 4.7.0.41.

 

When I try to call:

 

Graphics g = Graphics.create(bitmap);

 

sometimes I get "java.lang.IllegalArgumentException: Bitmap is too large for graphics surface" exception.

 

API says nothing about the issue, but I suppose there are some restrictions on the bitmap to create a Graphics object from. Where can I get those restrictions?

Message Edited by arhimed on 2009-04-19 10:09 PM
Message Edited by arhimed on 2009-04-19 10:10 PM
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: What are the restrictions on the bitmap to create a Graphics object from?

What is the dimension of the bitmap you passing to create Graphics.

Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: What are the restrictions on the bitmap to create a Graphics object from?

Yeah there is a limit on Bitmap dimensions. I do not know what they are, but you can find them by running a loop that creates a new Bitmap while increasing the size each time untill it crashes.
Developer
Posts: 51
Registered: ‎04-19-2009
My Device: Not Specified

Re: What are the restrictions on the bitmap to create a Graphics object from?

BBDeveloper, mreed, thanks for the response.

 

Meanwhile I still hope to get original info from the API creators. By the way, they do monitor the forum, don't they?

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: What are the restrictions on the bitmap to create a Graphics object from?

Well they do it periodically. Here is the link which tells about it.

 

Section: Blackberry Technical Advisors.

 

http://supportforums.blackberry.com/rim/board/message?board.id=Hello&thread.id=1


Use Search. "Accept Solution" If the problem is resolved.
BlackBerry Development Advisor
Posts: 15,055
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: What are the restrictions on the bitmap to create a Graphics object from?

Please refer to the following.

 

What Is - Screen buffer size
Article Number: DB-00489

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800608/...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker