![]() |
|
||||||||||
|
|||||
|
Banned
[+4 01.02.09]
[+1 01.02.09] |
На таймлайне (где-нибудь за видимой областью) символ targ (кружочек, с точкой отсчета в левом верхнем углу и сторонами 100х100 для простоты).
Собственно я его масштабирую (_xscale) и пытаюсь снять с него скриншот: import flash.display.BitmapData;
myBitmapData = new BitmapData(500, 500, false, 0x00CCCCCC);
mc = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());
targ._xscale=targ._yscale=500
mc.onPress = function() {
myBitmapData.draw(targ)
trace(targ._width+" "+targ._xscale)
}
Далее, усложняю. Помещаю в targ (пустой) клип-кружочек (все тот же) с именем ttt import flash.display.BitmapData;
myBitmapData = new BitmapData(500, 500, false, 0x00CCCCCC);
mc = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());
targ.ttt._xscale=targ.ttt._yscale=500
mc.onPress = function() {
myBitmapData.draw(targ)
trace(targ._width+" "+targ._xscale)
}
Вопрос: как же все-таки действует метод draw()??? |
|
|||||
|
Et cetera
Регистрация: Sep 2002
Сообщений: 30,787
|
Прочитайте про второй параметр в draw.
|
|
|||||
|
Banned
[+4 01.02.09]
[+1 01.02.09] |
Спасибо.
Помогло. Причем _xscale вовсе не нужен: import flash.display.BitmapData;
import flash.geom.Matrix;
myBitmapData = new BitmapData(500, 500, false, 0x00CCCCCC);
mc = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());
myMatrix = new Matrix();
myMatrix.scale(5,5)
mc.onPress = function() {
myBitmapData.draw(targ,myMatrix)
trace(targ.ttt._width+" "+targ.ttt._xscale+" "+targ._width+" "+targ._xscale)
}
|
![]() |
![]() |
Часовой пояс GMT +4, время: 16:18. |
|
|
« Предыдущая тема | Следующая тема » |
|
|