I have had a brief look at export_graphics@.
Writing to a file requires an open metafile. A quick and nasty way to get some output is illustrated here...
winapp
program gr3
integer ctrl,i,h
include <clearwin.ins>
i=winio@('%gr[rgb_colours]%lw',320,200,ctrl)
i=open_metafile@(0)
call draw_filled_rectangle@(0,0,320,200,0)
call draw_line_between@(0,0,320,200,RGB@(255,0,0))
call draw_line_between@(0,200,320,0,RGB@(0,255,0))
call draw_ellipse@(160,100,50,30,RGB@(0,0,255))
i=export_image@('file.emf')
i=close_metafile@(0)
end
There are at least two problems with this.
- The background filling does not appear in the file.
- An internal call to the Windows API function PlayEnhMetaFile fails for some unknown reason.
If you can manage without the background and can tolerate the error code then the result may be useful in some situations.
In theory there is support for bmp, pcx, emf, gif and jpg files.
I can not see anything for png files and I have no idea how much work this would involve.