set minHeight/minWidth = 0 on the HBox that you want to have scrollbars. ________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of truongdav Sent: Wednesday, April 18, 2007 9:53 AM To: [email protected] Subject: [flexcoders] Re: Converting TIFF to Jpg and sending as a bytestream I add a complete event listener like so loader.loadBytes(img); loader.contentLoaderInfo.addEventListener (Event.COMPLETE,imgLoaded); then in imgLoaded I set the width and height of the image to loader.content.width(height) and addChild. I wont bother with scaling yet.. but want to have the image in a smaller hbox with scroll bars enabled but cant seem to get it to work. It will display the entire image if I do not set width/height on the HBox but I cannot set a limit to the size of the Hbox. Anything I may be missing? Thanks. --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "Alex Harui" <[EMAIL PROTECTED]> wrote: > > images are loaded asynchronously, so at the time of layout we don't know > how big it will be. > > you might try waiting until a "complete" event before changing the > scale. > > ________________________________ > > From: [email protected] <mailto:flexcoders%40yahoogroups.com> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of truongdav > Sent: Tuesday, April 17, 2007 9:59 AM > To: [email protected] <mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] Converting TIFF to Jpg and sending as a bytestream > > > > Hi, > > I am trying to convert a tiff to a jpg and send to a preview screen > using a remote service and loading using Loader class. > Like this. > > var img : ByteArray = event.result as ByteArray; > var loader : Loader = new Loader(); > loader.loadBytes(img); > myModel.img.addChild(loader); > > <mx:HBox width="100%" height="100%"> > </mx:HBox> > <mx:HBox id="imageBox" horizontalScrollPolicy="on" > verticalScrollPolicy="on" width="100%" height="100%"> > <mx:image source="{myModel.img}" scaleX=".5" scaleY=".5"/> > </mx:HBox> > > I am having a problem with scaling and displaying using a hbox and > image tag it does not fit the image into the hbox as it does not seem > to recognize the size of the image and scrolling does not seem to > work. Pretty new with flex, so let me know if this is a bad approach. >

