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
Contributor
Posts: 39
Registered: ‎09-28-2010
My Device: Not Specified

Copy a mini image to BBM

Hi!

 

I need to copy a mini image to chat BBM and I do not know how to do it!

 

The scenario is as follows:

 

I have a series of images inside my application ( "img/img1.png", "img/img2.png", ... , "img/imgn.png" ) and I need the user has the possibility to copy someone of the image and paste into the chat to the BBM. I assume it's via the clipboard.

 

I try this:

 

Clipboard c = Clipboard.getClipboard();
c.put( Bitmap.getBitmapResource("img/icon1.png") );

 

and this:

 

PNGEncodedImage a = PNGEncodedImage.encode( Bitmap.getBitmapResource("img/iconNew.png") );
Clipboard c = Clipboard.getClipboard();
c.put( a.getData() );

 

but I did not accomplish anything.

 

Someone can help me?

 

Thanks!