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

Posts: 69
Registered: ‎08-13-2008
My Device: Not Specified
Accepted Solution

BlackBerryContact Photo to EncodedImage

Hi, i want to get a EncodedImage from the byte[] photo in the BlackBerryContact, How can i do this?

when i try to do it, an Illegal argumet exception is throws by the createEncodedImage(byte[] b,int offset, int length) ;

i invoke it in this way



byte[] binary = contact.getBinary(BlackBerryContact.PHOTO, BlackBerryContact.ATTR_NONE); EncodedImage imagen=EncodedImage.createEncodedImage(binary,0,binary.length);





BlackBerry Development Advisor
Posts: 15,882
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: BlackBerryContact Photo to EncodedImage

This is caused by an issue with the BlackBerry handheld software.  It has been resolved in BlackBerry handheld software version and higher.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.