a filled gray box with black border 
Author Message
 a filled gray box with black border

hello postscripts'gurus, i'm embarassed to ask you a very easy question:
i'm trying to draw a gray filled box with a black border:

%%!PS-Adobe-3.0
%%Orientation: Landscape
%%IncludeFeature: *PageSize A4
90 rotate
newpath
0 setlinewidth
25 -39 moveto
175 -39 lineto
175 -49 lineto
25 -49 lineto
closepath
0.9 setgray
fill
stroke

what i'm missing?
This draw a box without black borders, why?
Thank you for any suggestions.
Ciao
Stefano



Sat, 23 Oct 2004 16:39:57 GMT  
 a filled gray box with black border

Quote:

>hello postscripts'gurus, i'm embarassed to ask you a very easy question:
>i'm trying to draw a gray filled box with a black border:

...
>closepath
>0.9 setgray
>fill
>stroke

>what i'm missing?
>This draw a box without black borders, why?

fill does the equivalent of a newpath.  This is why you do not have to
start each path with newpath.

You could try

gsave fill grestore stroke

but this runs into the next problem with your code - you do nothing to
change the colour to black, so the border will be exactly the same
colour as the box, and so it will be invisible.
----------------------------------------

Visit http://www.*-*-*.com/ ,
PSAlter, psalters, tea, and small {*filter*} animals. And stuff.  



Sat, 23 Oct 2004 16:51:02 GMT  
 a filled gray box with black border

Quote:

> You could try

> gsave fill grestore stroke

> but this runs into the next problem with your code - you do nothing to
> change the colour to black, so the border will be exactly the same
> colour as the box, and so it will be invisible.

Why not just write

gsave fill grestore 0 setgray stroke

?

--Odysseus



Sun, 24 Oct 2004 08:23:10 GMT  
 a filled gray box with black border

Quote:


> > You could try

> > gsave fill grestore stroke

> > but this runs into the next problem with your code - you do nothing to
> > change the colour to black, so the border will be exactly the same
> > colour as the box, and so it will be invisible.

> Why not just write

> gsave fill grestore 0 setgray stroke

> ?

> --Odysseus

Thank you guys
: )
ciao
Stefano


Sun, 24 Oct 2004 15:51:27 GMT  
 a filled gray box with black border
Which is what you'd do of course. While I don't speak for Aandi, I think he
was trying to prompt the poster into discovering this for himself.


Quote:

> > You could try

> > gsave fill grestore stroke

> > but this runs into the next problem with your code - you do nothing to
> > change the colour to black, so the border will be exactly the same
> > colour as the box, and so it will be invisible.

> Why not just write

> gsave fill grestore 0 setgray stroke

> ?

> --Odysseus



Sun, 24 Oct 2004 21:14:53 GMT  
 a filled gray box with black border
Quote:

> Which is what you'd do of course. While I don't speak for Aandi, I think he
> was trying to prompt the poster into discovering this for himself.

Sorry for 'letting the cat out of the bag'. :(

--Odysseus



Mon, 25 Oct 2004 07:39:11 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Help printing black text on gray background?

2. Filling polygon with stroked border...

3. Gray out a text box

4. How to center a figure, and how to draw a border, or outline of box

5. Make black box go away?!?

6. gs3.51 under HP-UX shows black on black

7. Script Debugger Highlight=Black on Black!!

8. When Black "aint" Black

9. GS 3.12 under HP-UX: Black Paper, Black Window

10. fill in box

11. drop down edit boxes and filling them from a db

12. Automatically filling in a text box

 

 
Powered by phpBB® Forum Software