<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_51722"> 软件功能: <br> 1.带进度条加载头像<br> 2.可以裁切任意尺寸的图片大小<br> 3.上传完成后支持js回调<br> 4.支持摄像头拍照<br><br>注(早期练习之作,代码书写并不规范,搜狗浏览器下预览有点小问题,建议查看演示时使用其他浏览器) <div class="blockcode"> <div id="code_sb4"><ol> <li>package classes{</li> <li> import com.adobe.images.JPGEncoder;</li> <li> import flash.display.BitmapData;</li> <li> import flash.display.Sprite;</li> <li> import flash.net.URLLoader;</li> <li> import flash.net.URLRequest;</li> <li> import flash.net.URLRequestHeader;</li> <li> import flash.net.navigateToURL;</li> <li> import flash.utils.ByteArray;</li> <li> import flash.net.URLRequestMethod;</li> <li> import flash.net.URLLoader;</li> <li> import flash.net.URLLoaderDataFormat;</li> <li> import flash.events.Event;</li> <li> </li> <li>//画位图数据</li> <li>public class Test extends Sprite{</li> <li> private var jpgSource:BitmapData;</li> <li> private var jpgEncoder:JPGEncoder;</li> <li> private var jpgStream:ByteArray;</li> <li> private var jpgURLRequest:URLRequest;</li> <li> private var header:URLRequestHeader</li> <li> public function Test(){</li> <li> jpgSource=new BitmapData(mc.width,mc.height);</li> <li> jpgSource.draw(mc);</li> <li> jpgEncoder = new JPGEncoder(85); </li> <li> jpgStream = jpgEncoder.encode(jpgSource); </li> <li> <li> jpgURLRequest = new URLRequest("http://localhost/upload.php"); </li> <li> jpgURLRequest.contentType="application/octet-stream"; </li> <li> jpgURLRequest.method = URLRequestMethod.POST; </li> <li> jpgURLRequest.data = jpgStream; </li> <li> </li> <li> var loader:URLLoader = new URLLoader(); </li> <li> loader.dataFormat = URLLoaderDataFormat.BINARY; </li> <li> loader.load(jpgURLRequest); </li> <li> loader.addEventListener(Event.COMPLETE, completeHandler); </li> <li> }</li> <li> </li> <li> private function completeHandler(evt:Event):void { </li> <li> trace(evt.target.data); </li> <li> } </li> <li> <li> }</li> <li>}</li> </ol></div> <em onclick="copycode($('code_sb4'));">复制代码</em> </div> <img src="http://img.it-home.org/data/attachment/forum/2015pic/08140303_TZM9.png" alt="flash(as3.0) php 스크린샷 업로드 플러그인(모든 크기 조정 지원)" > </td></tr></table> <div id="comment_51722" class="cm"> </div> <div id="post_rate_div_51722"></div> <br><br>