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
Regular Contributor
rosemary123
Posts: 80
Registered: ‎10-20-2010
My Device: 8707

Re: png to bitmap error

[ Edited ]

I am able to draw EncodedImage. But when i try to .getBitmap, I will get exception for some of the images. I want to encode the image and log the errors when I tried to open them.

The problem now is that I can convert these images to bitmap. Or shall I try decoding it and if I can't to check for errors using event log?

Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: png to bitmap error

Ok, unfortunately I don't know exactly why you get the exception (since the normal causes don't apply to your situation). As long as you don't catch the exception then it will show up in the event log.

 

Can you notice any specific difference in the images that cause the error and those that don't? File size, image size, program that creates them, alpha/no-alpha, etc. ?

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Regular Contributor
rosemary123
Posts: 80
Registered: ‎10-20-2010
My Device: 8707

Re: png to bitmap error

When I try to go to sd card and open the image one by one, I notice that some images doesn't have a preview available. These are the ones I cant encode and change to bitmap. How do I log the event for these type of errors? Can i i use a EventLogger?

Developer
paulkayuk
Posts: 133
Registered: ‎04-30-2010
My Device: Curve 8520

Re: png to bitmap error

What are the dimensions (width and height) of the images which give you problems, and what are the dimensions of the images which work ok?
Regular Contributor
rosemary123
Posts: 80
Registered: ‎10-20-2010
My Device: 8707

Re: png to bitmap error

The okay ones is 125X94 while the one that's giving problem is 225X225.

Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: png to bitmap error

Do you think you can put one of them here for download?

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Regular Contributor
rosemary123
Posts: 80
Registered: ‎10-20-2010
My Device: 8707

Re: png to bitmap error

[ Edited ]

How do I do put it up for download?

 

Is there any other methods I can use to decode an image file instaead of using image.getbitmap?

Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: png to bitmap error

The attachments box (it's next to the message box when you make a post).

 

There is no other methods. Your options are getBitmap or to make a Bitmap, get a Graphics object for it, then draw the EncodedImage to it.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Regular Contributor
rosemary123
Posts: 80
Registered: ‎10-20-2010
My Device: 8707

Re: png to bitmap error

I dont see any attachment box. All i see is the insert/edit image(a tree). And i post my image on it.

 

 

Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: png to bitmap error

The box is to the right of the message box.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.