麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 開發 > Flex > 正文

存取flex屏幕快照

2024-09-12 17:51:12
字體:
來源:轉載
供稿:網友
<?xml version="1.0" encoding="utf-8"?>
<!-- http://yecon.blog.hexun.com/31031093_d.html -->
<Application name="FileReference_save_test"
xmlns="http://ns.adobe.com/mxml/2009"
xmlns:mx="library:adobe/flex/halo"
xmlns:net="flash.net.*"
layout="flex.layout.BasicLayout"
creationComplete="init();">
<Script>
<![CDATA[
private function init():void {
textArea.text = describeType(FileReference).toXMLString();
}
private function btn_click(evt:MouseEvent):void {
fileReference.save(textArea.text, "describeType.txt");
}
]]>
</Script>
<Declarations>
<net:FileReference id="fileReference" />
</Declarations>
<mx:Panel id="panel"
width="500"
height="300"
verticalCenter="0"
horizontalCenter="0">
<mx:TextArea id="textArea"
editable="true"
width="100%"
height="100%" />
<mx:ControlBar horizontalAlign="right">
<Button id="btn"
label="Save Text"
click="btn_click(event);" />
</mx:ControlBar>
</mx:Panel>
</Application>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//也可以通過XML對象直接使用FileReference類的save()方法:
<?xml version="1.0" encoding="utf-8"?>
<!-- http://yecon.blog.hexun.com/31031093_d.html -->
<Application name="FileReference_save_test"
xmlns="http://ns.adobe.com/mxml/2009"
xmlns:mx="library:adobe/flex/halo"
xmlns:net="flash.net.*"
layout="flex.layout.BasicLayout"
creationComplete="init();">
<Script>
<![CDATA[
private const xmlObj:XML = describeType(FileReference);
private function init():void {
textArea.text = xmlObj.toXMLString();
}
private function btn_click(evt:MouseEvent):void {
fileReference.save(xmlObj, "describeType.xml");
}
]]>
</Script>
<Declarations>
<net:FileReference id="fileReference" />
</Declarations>
<mx:Panel id="panel"
width="500"
height="300"
verticalCenter="0"
horizontalCenter="0">
<mx:TextArea id="textArea"
editable="true"
width="100%"
height="100%" />
<mx:ControlBar horizontalAlign="right">
<Button id="btn"
label="Save"
click="btn_click(event);" />
</mx:ControlBar>
</mx:Panel>
</Application>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//可以使用ImageSnapshot類來抓取截圖,并通過將ByteArray交給FileReference類的save()方法對象保存到本地硬盤:
<?xml version="1.0" encoding="utf-8"?>
<!-- http://yecon.blog.hexun.com/31031093_d.html -->
<Application name="FileReference_save_test"
xmlns="http://ns.adobe.com/mxml/2009"
xmlns:mx="library:adobe/flex/halo"
xmlns:net="flash.net.*"
layout="flex.layout.BasicLayout"
creationComplete="init();">
<Script>
<![CDATA[
import mx.graphics.ImageSnapshot;
import mx.graphics.codec.*;
private const jpegEnc:JPEGEncoder = new JPEGEncoder();
private const xmlObj:XML = describeType(FileReference);
private function init():void {
textArea.text = xmlObj.toXMLString();
}
private function btn_click(evt:MouseEvent):void {
var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(panel, 0, jpegEnc);
fileReference.save(imageSnap.data, "describeType.jpg");
}
]]>
</Script>
<Declarations>
<net:FileReference id="fileReference" />
</Declarations>
<mx:Panel id="panel"
width="500"
height="300"
verticalCenter="0"
horizontalCenter="0">
<mx:TextArea id="textArea"
editable="true"
width="100%"
height="100%" />
<mx:ControlBar horizontalAlign="right">
<Button id="btn"
label="Save"
click="btn_click(event);" />
</mx:ControlBar>
</mx:Panel>
</Application>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 国产深夜福利视频在线播放 | 羞羞漫画无遮挡观看 | 欧美h版电影在线观看 | 中文字幕 亚洲一区 | 国产精品1区 | 禁漫天堂久久久久久久久久 | 国产午夜免费福利 | 爱操影视 | 国产二区三区四区 | 性爱视频在线免费 | 亚洲3atv精品一区二区三区 | 日韩大片在线永久观看视频网站免费 | 无遮挡一级毛片视频 | 少妇淫片免费一级毛片 | 亚洲特黄妇女高潮 | 日本高清一级片 | 中国国语毛片免费观看视频 | 草久免费 | 超污视频在线看 | 国产一区视频观看 | 国产福利视频 | 成年人福利视频 | 欧美另类综合 | 国产成人精品日本亚洲语音 | 国产小视频一区 | 国产精品hd免费观看 | 主人在调教室性调教女仆游戏 | 国产精品久久久久久久久久 | 激情久久一区二区 | 成年人在线视频 | 精品成人在线 | 色视频在线观看 | 91一区二区三区久久久久国产乱 | 91午夜在线观看 | 成人午夜激情网 | a黄网站 | 蜜桃视频在线免费播放 | 黄色大片在线免费看 | 黄色男女视频 | 粉嫩蜜桃麻豆免费大片 | av电影院在线观看 |