【发布时间】:2010-06-12 07:26:11
【问题描述】:
跟进来自:As3 printing problem, blanks swf after print or cancel
我正在尝试想出一个无需创建精灵即可打印的功能,因为这似乎是导致我的问题的原因:
public function printScreen():void {
var pJob:PrintJob = new PrintJob();
var options:PrintJobOptions = new PrintJobOptions();
options.printAsBitmap = true;
var bitmapData:BitmapData = new BitmapData(root.width, root.height);
bitmapData.draw(root);
var printThis:Bitmap = new Bitmap(bitmapData);
try {
pJob.start();
pJob.addPage(printThis, null, options);
pJob.send();
}
catch(e:Error)
{
trace("Error Printing")
}
}
这是一个:
Error: Description Implicit coercion of a value of type flash.display:Bitmap to an unrelated type flash.display:Sprite.
那么如何在不创建 Sprite 的情况下打印位图呢?
【问题讨论】:
标签: flash actionscript-3 actionscript flex3 flexbuilder