gl:metafile
List of: Scheme Extensions
Subjects: Viewing
Contents: OpenGL

Action: Writes a view to a file in Windows Enhanced Metafile format.

Filename: gl/gl_scm/gl_scm.cxx

Syntax: (gl:metafile [filename] [view] [emf-wmf=#t]


[header=#f])

Arg Types: filename string

view view

emf-wmf boolean

header boolean

Returns: view

Description: When running on the Windows NT platform, this extension writes a view in Windows Enhanced Metafile format to a file or to the clipboard and returns the specified view to the output filename. gl:metafile sends the image to the output file, while render:metafile renders the image sent to the output file.


The emf-wmf argument controls whether an old style metafile (wmf) is made or the new enhanced format (emf) is made. If an old style is specified (#t), the header argument is used to add some extra header information that is required from some Windows programs such as Word. The metafile type defaults to #t which is an enhanced metafile. Header type defaults to #f which does not add the extra header.

Limitations: Supported on NT platforms only.

Example: ; gl:metafile

; Define a view

(define view1 (view:gl))

;; view1

(define title1 (view:set-title "view1" view1))

;; title1

(define view2( view:gl))

;; view2

(define title2 (view:set-title "view2" view2))

;; title2

(define body1 (solid:subtract


(solid:cylinder


(position 0 0 -10) (position 0 0 10) 10)


(solid:sphere (position 0 0 20) 20)


(solid:cylinder


(position 10 0 -10) (position 10 0 10) 5)


(solid:cylinder


(position -10 0 0) (position 10 0 0) 3)


(solid:cylinder


(position 0 -10 0) (position 0 10 0) 3)))

;; body1

; These are the metafile test cases.

; The following generates an enhanced metafile

(gl:metafile "c:/temp/gltest1.emf")

;; #[view 184420622]

; The following generates an enhanced metafile

; for view2

(gl:metafile "c:/temp/gltest2.emf" view2)

;; #[view 117705038]

; The following generates an enhanced metafile as

; specified from emf-wmf

(gl:metafile "c:/temp/gltest3.emf" #t)

;; #[view 184420622]

; The following generates an enhanced metafile

; for view2 as specified by the header argument.

(gl:metafile "c:/temp/gltest4.emf" view2 #t)

;; #[view 117705038]

; The following generates an old style metafile

; format without the header information

(gl:metafile "c:/temp/gltest5.wmf" #f)

;; #[view 184420622]

; The following generates an old style metafile

; format for view2 without the header information

; for view2

(gl:metafile "c:/temp/gltest6.wmf" view2 #f)

;; #[view 117705038]

; The following generates an old style metafile

; format for view2 with the extra header information

(gl:metafile "c:/temp/gltest7.wmf" #f #t)

;; #[view 184420622]

; The following generates an old style metafile

; format for view2 with the extra header information

(gl:metafile "c:/temp/gltest8.wmf" view2 #f #t)

;; #[view 117705038]

; The following generates an enhanced metafile

; that is sent to the clipboard (suggested format

; for clipboard transfers)

(gl:metafile)

;; #[view 184420622]
PDF/GL/01SC.PDF
HTM/DATA/GL/GL/01SC/0004.HTM