You cannot do that as flex is single threaded and convertToImage will take
all processing power... So even if you put a progress bar it will jump from
0 to 1...
I have seen a tutorial where this functionality is broken in chunks with
small modification to the encoding class but cannot remember where...
Anybody else remembers the link?
Fotis
On Mon, Nov 17, 2008 at 4:31 PM, sailorsea21 <[EMAIL PROTECTED]> wrote:
> Hi everyone, I have a button which renders my component to JPG.
> How can I attach a progress bar to show the progress of the rendering?
>
> <mx:Button label="render" click="renderasJPEG()"/>
>
> public function renderasJPEG():void
> {
> convertToImage(component001, new JPEGEncoder(100));
> }
>
> private function convertToImage(object:IUIComponent,
> encoder:IImageEncoder):void
> {
> var base64string:String = ImageSnapshot.encodeImageAsBase64(
> ImageSnapshot.captureImage(object, 72, encoder));
> var variables:URLVariables = new URLVariables();
> variables.encoded = base64string;
> variables.type = "jpeg";
> var request:URLRequest = new URLRequest("script_saveasimage.php");
> request.method = "POST";
> request.data = variables;
> navigateToURL(request, "_blank");
> }
>
> Thanks.
>
>
>
--
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[EMAIL PROTECTED],