Suivi de: As3 printing problem, blanks swf after print or cancelImprimer un bitmap sans imprimer un sprite?
Je suis en train de comeup avec une fonction d'imprimer sans créer une image-objet, parce que ce qu'il semble poser mon problème:
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")
}
}
Cela vient avec un :
Error: Description Implicit coercion of a value of type flash.display:Bitmap to an unrelated type flash.display:Sprite.
Alors, comment imprimer un bitmap sans créer un Sprite?