PDA

Просмотр полной версии : DropShadowFilter - не накладывается на Bitmap?


G.W.M
06.06.2006, 20:44
DropShadowFilter - не накладываетца на Bitmap в чом проблема вроде в helpe написано что он это поддерживает...


import flash.filters.DropShadowFilter;
import flash.display.BitmapData;

var form:BitmapData = BitmapData.loadBitmap('form');
var output:BitmapData = new BitmapData(form.width, form.height, true, 0xcccccc);
var shadow:DropShadowFilter = new DropShadowFilter(10, 10, 0xff0000, 100);
shadow.hideObject = true;
form.applyFilter(form, form.rectangle, new Point(), shadow);
attachBitmap(form, 0);

MyXus
06.06.2006, 21:28
А пробовал битмап дату в мув класть?

etc
06.06.2006, 22:12
import flash.display.BitmapData;
import flash.filters.BevelFilter;
import flash.filters.DropShadowFilter;
import flash.geom.Point;

var myBitmapData:BitmapData = new BitmapData(100, 80, true, 0xCCCCCCCC);

var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());

var filter:DropShadowFilter = new DropShadowFilter(10,10,0,100,10,10,1,2,false,false,true);

mc.onPress = function() {
myBitmapData.applyFilter(myBitmapData, myBitmapData.rectangle, new Point(0, 0), filter);
}
Цитата из хелпа:
BevelFilter, DropShadowFilter, GlowFilter -- The destination image of these filters must be a transparent image. Calling DropShadowFilter or GlowFilter creates an image that contains the alpha channel data of the drop shadow or glow. It does not create the drop shadow onto the destination image. If you use any of these filters with an opaque destination image, an error code value of -6 is returned.
Перевести?

Поэтому юзаем copyPixels