Functional PostScript Examples

Functional PostScript Examples


Turkey Bitmap

Turkey bitmap demonstrates how pictures can be created from bitmaps (so that it can be passed to the 'show' operator and rendered) First the bitmap data is read from a hex string, and then the bitmap is turned into a picture. [PostScript Output]

(define turkey-data
  "003B000027000024800E494011492014B2203CB65075FE8817
  FF8C175F141C07E23803C4703182F8EDFCB2BBC2BB6F8431BFC
  218EA3C0E3E0007FC0003F8001E18001FF800")

(define (turkey width height)
  (translate (/ (- (inch 8.5) width) 2)
	     (/ (- (inch 11)  height) 2)
	     (scale width height
		    (bitmap->pict (hex-string->bitmap 23 24 1 
						      'gray turkey-data)))))


FPS Home | Prev Example | Next Example

FPS Examples: Right-angle Fractal | Arrow Fractal | Headlines | Clipping Message | Turkey Bitmap | Sun | Bounding Box | Morphing Square to Circle | Text Along a Circle | Demo Driver