in reply to Re: shading boxes using PostScript::Simple
in thread shading boxes using PostScript::Simple

adds_work:

Hmmm...I tried your example, but when using ghostview to see it, I didn't see the rectangle. I added the "filled=>1" from your example to the example from the PostScript::Simple documentation, and it worked just fine. It seems to me that your units are off and that you're drawing the (huge) rectangle off the page.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

  • Comment on Re^2: shading boxes using PostScript::Simple

Replies are listed 'Best First'.
Re^3: shading boxes using PostScript::Simple
by spider122 (Initiate) on Oct 07, 2011 at 13:44 UTC
    Thanks for the help. The example shown doesn't show the box on the screen, but I was able to get it to work. I need a box with a black border and filled grey. I assume I should just draw it twice and set the color differently in between:
    use PostScript::Simple; # create a new PostScript object $p = new PostScript::Simple(papersize => "A4", colour => 1, eps => 0, units => "pt"); # create a new page $p->newpage; #select black to do border $p->setcolour("black"); $p->box(10,10,50,50); #select a shade of grey $p->setcolour("grey50"); $p->box( {filled => 1}, 10,10,50,50); $p->output("file.ps");