-
[RESOLVED] Print masked shape?
Hey guys, is there anyway I can print a masked shape?
I'm doing a drawing application, and the 'paint' on it is a mask. When I try to print, it either prints only the whole mask, or only the shape, all in black.
Any help is much appreciated!
-
Senior Member
How do you create the mask, probably not by code?
- The right of the People to create Flash movies shall not be infringed. -
-
hi cancerinform, thanks for the reply.
And yes, the mask is created by code...I believe its this one (I'm new on AS3...if its not, please tell me.)
maskmovieclip.cacheAsBitmap = true;
draw.cacheAsBitmap = true;
maskmovieclip.mask = draw;
-
no one?
-
Senior Member
This works. You have a MovieClip mc on the stage and another Movieclip myMask as a mask over it. Then you have a function with a printjob.
PHP Code:
import flash.events.MouseEvent;
import flash.printing.PrintJob;
mc.mask = myMask;
addEventListener (MouseEvent.CLICK, ch);
function ch (e:MouseEvent)
{
var pj:PrintJob = new PrintJob();
if (pj.start())
{
try
{
pj.addPage (mc);
}
catch (e:Error)
{
// handle error
}
}
pj.send ();
}
- The right of the People to create Flash movies shall not be infringed. -
-
I gave it a try, cancer...but, as I said, it's only printing the shape in black, or printing the whole mask...
I'm trying to print both at the same page...I believe this is not possible using PrintJob?
sorry for me being such a noob.
-
Senior Member
The script I provided prints only the masked area in the correct color. To print anything from flash you can only use the printjob.
- The right of the People to create Flash movies shall not be infringed. -
-
that's odd...i did the code exactly as you did, but it prints the stupid whole mask..
here's the printJob code.
PHP Code:
function imprime (e:MouseEvent){
var imprime:PrintJob = new PrintJob();
var options:PrintJobOptions = new PrintJobOptions();
options.printAsBitmap = true;
if(imprime.start()) {
try {
imprime.addPage(maskmovieclip);
} catch(e:Error) {
// do nothing
}
imprime.send();
}
}
-
Senior Member
It will print the mask only when the mask is the object to print and when the mask does not function as the mask.
- The right of the People to create Flash movies shall not be infringed. -
-
stupid me, I forgot to set the mask in the function. It worked pretty well.
thank you very very very much, cancerinform!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|