易截截图软件、单文件、免安装、纯绿色、仅160KB

flash 交互操作:裁剪位图

  玩过截图的人都知道截图是怎样一回事,通过截取图片一个地方就能够获取到图片某一个片段。这一个部分在flash 里面可以利用位图的复制像素来实现。通过copyPixels 或者draw 能够获取像素。
  现在我们讨论一个话题:在flash里面怎样实现这种截图? 带着这个问题,尝试制作一个demo出来。功能就是获取位图。
  所需要的材料:第一就是flash绘图API ,第二就是位图像素操作。利用这两个我们就能够实现出这种交互效果。
 设计的图案:
制作思路:首先知道怎样绘制一个矩形,可以上网搜索一下,或者查询一些flash绘图API 是如何操作的。借助绘制这股矩形,我们就能截取到我们所需要的片段。
 
接下来,为程序写一个基类:Item.as
定义一些常用的方法和属性。
例如绘制矩形。获取位图,定义线条的样式等,判断矩形是否有效
这些方法都是定义在这个基础类当中。
package org.summerTree
{
//选择类基本设置
import flash.display.Sprite;
import flash.geom.Rectangle;
import flash.events.EventDispatcher;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.geom.Point;
public class Item extends EventDispatcher
{
public var LineColor:int=0x0000ff;//线条颜色
public var FillColor:int=0x0000ff;//填充的颜色
public var FillAlpha:Number=0.1;
public function Item()
{
}
//绘制矩形的基本方法
protected function DrawRect(shape:Sprite,rect:Rectangle):void
{
shape.graphics.clear();
shape.graphics.lineStyle(1,LineColor,1);
shape.graphics.beginFill(FillColor,FillAlpha);
shape.graphics.drawRect(rect.x,rect.y,rect.width,rect.height);
shape.graphics.endFill();
}
//判断rect是否有效
public function checkRect(rect:Rectangle):Boolean
{
return rect != null?true:false;
}

//定义样式
public function setStyle(lcolor:int,fcolor:int,aplha:Number):void
{
this.LineColor=lcolor;
this.FillColor=fcolor;
this.FillAlpha=aplha;
}
//获取位图
public function getImage(source:Bitmap,rect:Rectangle):Bitmap
{
var bitmapdata:BitmapData = source.bitmapData;
var Width:Number=Math.abs(rect.width);


相关文档:

Adobe Flash Player

Want play some .SWF files, so download "Adobe flash player for IE", then install successfully, but it is a plug, can't open the swf files independently, by the other word, I just can play them in IE, but I don't like so.
At first, I think there is a .exe player can be executing, so locate C:\windo ......

Metal F1 USB Flash Drive

HTML clipboardThese days a
16GB USB thumb drive
is as necessary as your house keys. Whether you are
taking large work files back and forth from the office or are sharing pictures,
videos, and music with friends, nothing beats the convenience of a USB storage
drive. Well, why not make sure t ......

Ubuntu下Flash中将汉字显示为方格的解决办法

Ubuntu下装完Adobe的Flash插件后,浏览器里可以播放Flash动画了。但是还存在一个问题就是汉字无法正确显示,显示为方格
解决办法:
修改这个配置文件
/etc/fonts/conf.d/49-sansserif.conf
把其中所有的字体名替换为中文字体名即可,我这里用的是“微软雅黑”和“Consolas“。
<?xml version=" ......

Gentoo安装64位flash player

    之前在Windows下用过Firefox的64位版本-Shiretoko,但是由于64位的flash player plugin一直安装不上,导致很多应用都用不了,据说可以使用NSPlugin Wrapper包和32位的类库来使用32位的flash player,我没有尝试。最近安装了64位的Gentoo,opera和shiretoko还是无法自动安装64位的flash player plugin。 ......

flash资料

ScrollPane加载图片:http://flash.9ria.com/viewthread.php?tid=37296&highlight=ScrollPane
SoundChannel控制声音:http://flash.9ria.com/viewthread.php?tid=25745&highlight=Sound
捕获窗体变化事件:http://flash.9ria.com/viewthread.php?tid=7203&highlight=%E6%9C%80%E5%A4%A7%E5%8C%96
加载和卸载 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号