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

Adobe AIR Development

Reply
Developer
Deepu_George_Jacob
Posts: 234
Registered: ‎12-13-2011
My Device: Curve 9380
My Carrier: Vodafone-IN

How to convert images into bit map??

Hai,

      I am trying to convert images into bitmap data..Images are loaded from internet anybody knows its solution help me .

Thanks

Deepu

Please use plain text.
Developer
zezke
Posts: 1,004
Registered: ‎12-12-2010
My Device: Z10 (red Limited Edition)
My Carrier: Mobile Vikings

Re: How to convert images into bit map??

var bitmap:Bitmap;

private function loadImage():void
{
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
loader.load(new URLRequest("http://www.blogcdn.com/www.autoblog.com/media/2011/04/lead9-2012-ferrari-ff.jpg"));
}

private function onComplete (event:Event):void
{
    bitmapData = Bitmap(LoaderInfo(event.target).content);
}

 



-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Please use plain text.
Developer
Deepu_George_Jacob
Posts: 234
Registered: ‎12-13-2011
My Device: Curve 9380
My Carrier: Vodafone-IN

Re: How to convert images into bit map??

thanks But I need to know how to convet byte array to image also...

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: How to convert images into bit map??

What have your tried? Have you tried any searches?
Please use plain text.
Contributor
satyaveer
Posts: 24
Registered: ‎11-04-2011
My Device: Bold 9700
My Carrier: Dbydx Software

Re: How to convert images into bit map??

try this:

 

 


byte[] b = IOUtilities.streamToBytes(***enter your InputStream*****);
bitmp=Bitmap.createBitmapFromBytes(b , 0 , b.length , 1);



Please use plain text.