1
從隨訪: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的情況下打印位圖?