A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Opinions on the best way to send an image to a server (ASP.NET C#) and save it

  1. #1
    AS3 Mod
    Join Date
    Sep 2007
    Location
    O-H-I-O
    Posts
    2,385

    Opinions on the best way to send an image to a server (ASP.NET C#) and save it

    My process is the following...

    1) Send image from flash to server
    2) Server reads data from flash and sends proper headers for flash to pickup and read back into memory to save to local disk

    Currently I am sending a huge pixel string using the following code:

    Actionscript Code:
    var jpgSource:BitmapData = new BitmapData(IMAGE_VIEWPORT.width, IMAGE_VIEWPORT.height);
                jpgSource.draw(viewPort);
               
                var output:String = "";
                var col:String = "";
                for(var i:Number=0;i<jpgSource.height;i++)
                {
                    for(var j:Number=0;j<jpgSource.width;j++)
                    {
                        col = jpgSource.getPixel(j, i).toString(16);
                        while(col.length < 6)
                        {
                            col = "0" + col;
                        }
                        output += col;
                    }
                }

    Then I process that in C# returning an image object in the header back to flash.

    Does anyone have any better suggestions? I haven't done much image manipulation with flash but I feel like this method is not the best route.

  2. #2
    AS2 intolerant person
    Join Date
    Jan 2009
    Location
    Swansea
    Posts
    352
    which part do you feel is done incorrectly? the way the image is sent to the server or the way it is returned to flash?

  3. #3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center