1
我要填充的BitmapData使用不同的變換和混合-模式透明子畫面使用的BitmapData.draw()時。繪圖後,它會在圖像邊界上產生亮線。錯誤與混合-模式
下面是結果的屏幕截圖,而不使用時混合-模式 http://www.flasher.ru/forum/attachment.php?attachmentid=30348&stc=1&d=1389390901
這裏示例的代碼,如singleSp可以使用任何透明圖像
package
{
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.geom.ColorTransform;
import flash.geom.Matrix;
import flash.geom.Rectangle;
import flash.display.StageScaleMode;
import flash.display.StageAlign;
public class Main extends Sprite
{
[Embed(source = "assets/pic1.png")]
public var singleSp:Class;
var picBD:BitmapData;
var picBM:Bitmap;
public function Main():void
{
picBD = new BitmapData(600, 600, true, 0);
picBM = new Bitmap(picBD, "auto", true);
addChild(picBM);
var tr:Matrix = new Matrix();
var drawIm:BitmapData = (new singleSp as Bitmap).bitmapData;
for (var i:int = 0; i < 30; i++) {
var scale:Number = 0.3 + Math.random() * 0.8;
tr.setTo(1, 0, 0, 1, 0, 0);
tr.scale(scale, scale);
tr.rotate(Math.random() * 2);
tr.tx = Math.random() * 150 + 150;
tr.ty = Math.random() * 150;
picBD.draw(drawIm, tr, new ColorTransform(1,1,1,0.4), "invert", null, true);
}
}
}
使用混合-模式 http://www.flasher.ru/forum/attachment.php?attachmentid=30347&stc=1&d=1389390901 並導致}
如果你不這樣做將顏色轉換爲繪畫是什麼?會有邊界嗎? – Vesper
不幸的是 – artics
什麼混合模式的原因?也許只是「反轉」?我懷疑是因爲反演內部使用1-alpha邊界來執行混合,而不是0-alpha,而這些就是你所看到的。所以我懷疑這是一個錯誤。 – Vesper