[Haskell-cafe] Converting image2PS function
iliali16
iliali16 at gmail.com
Tue Mar 18 11:00:31 EDT 2008
Hi guys again just want to ask you I have this function ready
-- Creates a Postscript file from an Image
-- page shows -200 <= x <= 200, 300 <= y <= 300
-- boundaries, plus origin plotted on output
image2PS:: Image -> String -> IO()
image2PS (Image contents) filename =
writeFile filename (header++contents++footer)
where
header = unlines
["%!PS-Adobe-3.1"
,"%%BoundingBox: 100 125 500 725"
,"%%PageOrder: Ascend"
,"%%Pages: 1"
,"%%BeginDocument"
,"%%Page: 1 1"
,"100 125 moveto 500 125 lineto 500 725 lineto 100 725 lineto
closepath gsave stroke grestore clip"
,"275 425 moveto 50 0 rlineto stroke"
,"300 400 moveto 0 50 rlineto stroke"
]
footer = unlines
["showpage"
,"%%EndDocument"
]
but when I use it for example
image2PS spiral iliali
it tells me that the iliali is undefined. What do you thing how should I use
it. Thanks in advance!
PS: I need to know how this works so that I make a similar function that
converts logo2PS since I have a Logo spiral and I want to see it in
PostScript. Thanks again!
--
View this message in context: http://www.nabble.com/Converting-image2PS-function-tp16122095p16122095.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
More information about the Haskell-Cafe
mailing list