package com.makyoo.bitmapchange{ //www.makyoo.cn makyoo QQ:84407979
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.display.Bitmap;
import flash.display.BitmapData;
public class Bitmapchange extends Sprite {
//上下翻转
public static function upanddown(bt:BitmapData):BitmapData {
var bmd:BitmapData = new BitmapData(bt.width, bt.height, true, 0x00000000);
for (var xx=0; xx<bt.width; xx++) {
for (var yy=0; yy<bt.height; yy++) {
bmd.setPixel32(xx, bt.height-yy-1, bt.getPixel32(xx,yy));
}
}
return bmd;
}
//左右翻转
public static function rightandleft(bt:BitmapData):BitmapData {
var bmd:BitmapData = new BitmapData(bt.width, bt.height, true, 0x00000000);
for (var yy=0; yy<bt.height; yy++) {
for (var xx=0; xx<bt.width; xx++) {
bmd.setPixel32(bt.width-xx-1, yy, bt.getPixel32(xx,yy));
}
}
return bmd;
}
}
}
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.display.Bitmap;
import flash.display.BitmapData;
public class Bitmapchange extends Sprite {
//上下翻转
public static function upanddown(bt:BitmapData):BitmapData {
var bmd:BitmapData = new BitmapData(bt.width, bt.height, true, 0x00000000);
for (var xx=0; xx<bt.width; xx++) {
for (var yy=0; yy<bt.height; yy++) {
bmd.setPixel32(xx, bt.height-yy-1, bt.getPixel32(xx,yy));
}
}
return bmd;
}
//左右翻转
public static function rightandleft(bt:BitmapData):BitmapData {
var bmd:BitmapData = new BitmapData(bt.width, bt.height, true, 0x00000000);
for (var yy=0; yy<bt.height; yy++) {
for (var xx=0; xx<bt.width; xx++) {
bmd.setPixel32(bt.width-xx-1, yy, bt.getPixel32(xx,yy));
}
}
return bmd;
}
}
}