That mgiht work, and can be done entirely in MXML, but others are suggesting you learn how to use DisplayObject.mask. You can also create your own flash.display.Bitmaps by cutting up the original Bitmap and hand those to mx:Image as well.
________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Blake Barrett Sent: Tuesday, August 05, 2008 4:05 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: How do I show only part of an image? You may have to wrap each <mx:Image/> with an <mx:Canvas clipContent="true"><mx:Image/></mx:Canvas> and manipulate the canvases by positioning the <mx:Image/> and scaling the <mx:Canvas/> to get the image where you want it. Like this: <mx:Canvas clipContent="true" width="16" height="16"> <mx:Image width="64" height="64" x="-48" y="-48"/> </mx:Canvas> That should give you somewhere to start. Blake ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of whatabrain Sent: Tuesday, August 05, 2008 3:59 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: How do I show only part of an image? Not really sure what that means. But I'll explain my situation better... I have multiple <mx:Image> tags whose size is 16x16. I also have a larger image, say 64x64, which is a tiled array of 16x16 icons. I'd like to show a different piece of the 64x64 image in each <mx:Image>. --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "flexawesome" <[EMAIL PROTECTED]> wrote: > > are you able to use the mask? > > --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "whatabrain" <junk1@> wrote: > > > > Let's say I have a 64x64 image, but I only want to display one > 16x16 > > section of it. How would I do this? I tried playing with > > img.transform.pixelBounds.offset(), but it didn't do anything. > > > > > > <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml> " > > implements="mx.controls.listClasses.IDropInListItemRenderer"> > > > > <mx:Script> > > <![CDATA[ > > override public function set data(value:Object):void > > { > > super.data = value; > > img.transform.pixelBounds.offset(6,6); > > } > > > > // Implement IDropInListItemRenderer > > private var m_listData:BaseListData; > > public function get listData():BaseListData {return m_listData;} > > public function set listData(value:BaseListData):void {m_listData = > > value;} > > ]]> > > </mx:Script> > > > > <mx:Image height="16" width="16" source="/images/a.gif" id="img"/> > > > > </mx:VBox> > > >