Results 1 to 2 of 2

Thread: JPEG Encoder

  1. #1
    Join Date
    Oct 2008
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Red face JPEG Encoder

    Really lost with this code, their is a as file I will try to attach. I really get so many errors with this code. I want my composite of MC's to be able to
    converted into a JPEG with a save button. I don't know what parts to change for my own work.
    http://rapidshare.com/files/16234652...ncoder.as.html
    here is the other file.


    import SMP.Attila.booCrew.src.JPGEncoder;

    function createJPG(m:MovieClip, q:Number, fileName:String)
    {
    var jpgSource:BitmapData = new BitmapData (m.width, m.height);
    jpgSource.draw(m);
    var jpgEncoder:JPGEncoder = new JPGEncoder(q);
    var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);

    var header:URLRequestHeader = new URLRequestHeader ("Content-type", "application/octet-stream");

    //Make sure to use the correct path to jpg_encoder_download.php
    var jpgURLRequest:URLRequest = new URLRequest ("jpg_encoder_download.php?name=" + fileName + ".jpg");
    jpgURLRequest.requestHeaders.push(header);
    jpgURLRequest.method = URLRequestMethod.POST;
    jpgURLRequest.data = jpgStream;

    var jpgURLLoader:URLLoader = new URLLoader();
    navigateToURL(jpgURLRequest, "_blank");
    }


    //Call the function and pass in the movieclip that you want to encode,
    //the quality, and the file name
    createJPG(canvas12_mc, 90, "image");

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Have a look at this simple tutorial
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

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