flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chris_d_k ...@christiankiefer.de>
Subject Flex Mobile - Resize Image and send to server with blazeds
Date Sun, 27 Sep 2015 19:53:11 GMT
I have taken a photo with the camera roll and I am able to display it :

        private function imageSelected(e:MediaEvent):void
        {
            var mediaPromise:MediaPromise = e.data;
            this.mpLoader = new Loader();
            this.mpLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
onMediaPromiseLoaded);
            this.mpLoader.addEventListener(IOErrorEvent.IO_ERROR,
onMediaPromiseLoadError);
            this.mpLoader.loadFilePromise(mediaPromise);
        }

        private function onMediaPromiseLoaded(e:Event):void
        {
            var mpLoaderInfo:LoaderInfo = e.target as LoaderInfo;
            mpLoaderInfo.removeEventListener(Event.COMPLETE,
onMediaPromiseLoaded);
            mpLoaderInfo.loader.removeEventListener(IOErrorEvent.IO_ERROR,
onMediaPromiseLoadError);

            imageDisplay.width = CONTENT_WIDTH;
            imageDisplay.height = (CONTENT_WIDTH / mpLoader.width) *
mpLoader.height;
            imageDisplay.source = mpLoaderInfo.loader;
        }

I have a button and when I press it I want to send the image scaled
(proportionally to 1000px) to the server (we use BlazeDS). What's the best
way to achive this?



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Flex-Mobile-Resize-Image-and-send-to-server-with-blazeds-tp11237.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Mime
View raw message