<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute" 
creationComplete="appInit();">
 
 <mx:Script>
  <![CDATA[
   
   private function appInit():void {
    trace("Application ::: appInit")
    var imgReq:URLRequest = new URLRequest("images/risotto010.jpg");
    var imgLoader:Loader = new Loader();
    imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, 
imgCompleteHandler);
    imgLoader.load(imgReq);
   }
   
   private function imgCompleteHandler(evt:Event):void {
    trace("Application ::: imgCompleteHandler")
    var loader:LoaderInfo = evt.currentTarget as LoaderInfo;
    // grab image
    var bmp:Bitmap = loader.content as Bitmap;
    // grab image bitmapdata
    var bmd:BitmapData = bmp.bitmapData;
    // create new Bitma with bitmapdata and use as source for Image component
    bitmapImg.source = new Bitmap(bmd);
   }
   
  ]]>
 </mx:Script>
 
 <mx:Image id="bitmapImg" />
 
</mx:Application>

regards,
Muzak

 On 11/7/07, handitan <[EMAIL PROTECTED]> wrote:
>>
>>   Hi Muzak,
>>
>> Thank you for the suggestion.
>> Hmmm..how do you transform it to a BitmapData? So far I haven't
>> gotten any success out of it.
>>
>> --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, "Muzak"
>> <[EMAIL PROTECTED]> wrote:
>> >
>> > Display the images as bitmapdata in the itemrenderer.
>> > So rather than passing the image url to the itemrenderer, load the
>> image upfront, transform into bitmapdata and pass that on to the
>> > itemrenderer.
>> >
>> > Haven't tried it, but think it should work.
>> >
>> > regards,
>> > Muzak
>> >
>> > ----- Original Message -----
>> > From: "handitan" <[EMAIL PROTECTED]>
>> > To: <flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>>
>> > Sent: Monday, November 05, 2007 12:16 AM
>> > Subject: [flexcoders] Re: Flex 2.0.1: itemRenderer won't get
>> printed using PrintDataGrid
>> >
>> >
>> > I try to use SuperImage but I couldn't get it to work as an
>> > itemRenderer.
>> >
>> > If there's any other way besides using SuperImage, I am all ears.
>> >
>>
>> 
>>
>


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to