Hi all,
I'm new to flex, I've started reading the adobe documentation and
looking around for examples in the net.
And now I've started to do my first program.
I'm developer and maintainer for the IIPImage software,
iipimage.sf.net , and I would like to provide it with a flash viewer.
I've started investigating httpservice and the result is not so good,
I query the server for a jpeg image, the server send to me a jpeg but
I get only the header!
this is the code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
    creationComplete="iipRequest.send()"
    layout="absolute"
    xmlns:ext="nl.wv.extenders.panel.*"
>
<!-- Model -->

        <mx:Style source="fiipimage.css"/>

<!-- Controller -->
<mx:Script>
        <![CDATA[
        import mx.controls.Alert;
        import mx.rpc.events.ResultEvent;
        import mx.rpc.events.FaultEvent;
        import mx.rpc.http.HTTPService;
        
        var IIPIserver:String =
"http://merovingio.c2rmf.cnrs.fr/fcgi-bin/iipsrv.fcgi?";;
        var IIPFIF:String = "FIF=/home/images/Louvre.tif";
        var IIPQLT:int = 75;
        var IIPWID:int = 100;
        var IIPCVT:String = "jpeg";
        ]]>
</mx:Script>

<!-- HTTPService -->
<mx:HTTPService id="iipRequest"
        url="{IIPIserver}{IIPFIF}" method="GET" resultFormat="text"
        fault="Alert.show( event.fault.faultString )"
        showBusyCursor="true">
        <mx:request>
                <QLT>{IIPQLT}</QLT>
                <WID>{IIPWID}</WID>
                <CVT>{IIPCVT}</CVT>
        </mx:request>
</mx:HTTPService>

<!-- View -->

<!-- Effects -->

<!-- User Interface -->

<mx:Panel title="FIIPImage" width="100%" height="100%" >
        <mx:Canvas height="100%" width="100%">
                <ext:SuperPanel id="previewSuperPanel" title="Preview"
                        height="100" width="100" 
                        layout="absolute" showControls="true" 
enableResize="true">
                </ext:SuperPanel>
                <mx:Image id="preview" source="{iipRequest.lastResult}"/>
                <!-- Stagger the position of the TextInput controls using 
absolute
positioning.-->
                <mx:Text x="50" y="5" text="{IIPFIF}"/>
                <mx:Text x="50" y="30" text="{IIPQLT}"/>
                <mx:Text x="50" y="55" text="{IIPWID}"/>
                <mx:Text x="50" y="70" text="{IIPCVT}"/>
    
                <mx:Text right="25" y="110" text="{iipRequest.lastResult}"/>
        </mx:Canvas>
</mx:Panel>
</mx:Application>

Thanks for your help,
Denis

Reply via email to