Skip to main content
Known Participant
July 22, 2008
Question

stroke and fill

  • July 22, 2008
  • 45 replies
  • 10666 views
I read in the PostScript documentation and i saw that stroke only has :
-linecap
-color
-mitterlimit
-linejoin
-thickness

I have to write an application and my class
Stroke, that i am using, has a lot of other stuff like PatternBrush, ImageBrush ,GradientBrush , etc.

Can i get this kind of options for stroke in a PostScript file?
How about Fill?
(I'm very interested in the gradient option. I haven't found so far very clear documentation about it)

Can I get a detailed explanation or(and) some reference?

[later edit]
Also, can i modify the matrix in one command (without using rotate, scale and translate).I bumped to this only when i was dealing with images and i haven't found something clear in the documentation about how can i do this just by a command. For now i just want to draw from the upper left corner of the page, but i will need it for other stuff too.

David
This topic has been closed for replies.

45 replies

Known Participant
July 24, 2008
I got it.
And another thing, if i am using a hexadecimal representation for images, does bits per component gives the info about how many colors it can use to draw it I am interested to 3 and 4.

David
Participating Frequently
July 24, 2008
BitsPerComponent indicates how many bits are used to store each
component and nothing else. But it does limit the number of separate
colours.

For example, with 4 bits per component, there are 16 possible values
to a component. An RGB image with 4 bits per component would therefore
have 16 x 16 x 16 possible distinct colours.

But I sense you are asking about something else, when you say you are
interested in "3 and 4". Can you give more details?

Aandi Inston
Known Participant
July 24, 2008
I have another question.

I tried to draw a line with the following color:

200 143 120 setrgbcolor

and it doesn't seem to work

if i change only that line like:

255 0 0 setrgbcolor

it draws a red line.
What am I doing wrong?

David
Participating Frequently
July 24, 2008
You are not using the correct ranges for the color values. You are
assuming that they lie in the range 0 to 255, but that is not the
case. See "DeviceRGB color space" in 4.8.2. Each color space may have
different colorant ranges.

You may have seen 0..255 in RGB PostScript images, but this is just a
representation to be scaled to the true value using the (supplied or
default) Decode values. It would be 0..15 in a 4-bits-per-component
image, to represent the same range of values.

Aandi Inston
Known Participant
July 23, 2008
It is a lot to read and I lost myself a little bit.
I'm sorry if I ask too silly questions .

David
Known Participant
July 23, 2008
Can you give me an answer about the second question (matrix transformation)?

David
Participating Frequently
July 23, 2008
"concat".

Aandi Inston
Participating Frequently
July 22, 2008
You can use a tiling pattern to produce an implementation of a brush.
A pattern is, in effect, a color, so after using setcolorspace and
setcolor to set a pattern color, fill, eofill, stroke, imagemask and
the text operators will all paint with your brush.

Aandi Inston