Board index » delphi » Graphic dump to post script file

Graphic dump to post script file

I would like to know how to get dump a screen (graphic) to a post script
file. Is there a piece of software to do the job, or do I have to fix
something myself? If in the latter case, haw can I do this?
 

Re:Graphic dump to post script file


In article <4jmgaf$...@gjallar.daimi.aau.dk>, S|ren Kristian Dideriksen

Quote
<soren@?.?> wrote:
>I would like to know how to get dump a screen (graphic) to a post script
>file. Is there a piece of software to do the job, or do I have to fix
>something myself? If in the latter case, haw can I do this?

I have done this, but do not have the code here.  I assume that you have
a non-colour printer, so first set up a mapping between screen colours
and black/white.

"All" that one needs to do is to get the screen size, loop with GetPixel
through the screen, and generate Postscript "0 1 rmoveto" for a white
pixel and "0 1 rlineto" for a black one, with "stroke" and suitable
absolute positioning between screen lines.  This will generate a
ginormous file, however, but you can very easily encode runs of
black/white as "n B" and "m W". You will need to read the admirable
Adobe Red Book on Postscript.

If there is interest, j...@dclf.npl.co.uk has the code, somewhere.

--
John Stockton, Surrey, UK.  Turnpike v1.12.  MIME.

Other Threads