Re: How to import line graphics ?

Boyd Sweeney (starnet!apple!puzzler.nichols.com!sweeneyb)
Fri, 23 Sep 1994 16:37:25 -0500

>Hi
>
>I would like to generate line/polygon graphics in MetaCard based on
>x,y-coordinate data read in from a file. Ideally I would like to import
>something like FrameMaker's mif format or MacDraw's PICT format
>directly, but I guess that is asking too much. I would like to be able
>to pan and zoom in and out on this graphics and have MetaCard
>regenerate the drawing accordingly.
>
>Has anyone tried to do something like this ?
>
>Vegard Vesterheim : Phone: +47 73593885
>Production Engineering, SINTEF : Fax: +47 73597043
>N-7034 Trondheim, NORWAY : Email: vegardv@protek.unit.no

Assuming that you have an ascii file named points.txt, with one xy
coordinate per line, the following button script will allow you to import a
polygon.

on mouseUp
create graphic
set the style of graphic 1 to "polygon"
open file "points.txt" for read
read from file "points.txt" until eof
close file "points.txt"
set the points of graphic 1 to it
end mouseUp

You could use to "magnify" property to zoom in on the graphic, just like
you would with an image. But this opens another window, which I don't
believe is what you want. Interactive zooming and panning is going to be a
bit more difficult. I think you'll have to resize and place the graphic on
your own.

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ Boyd Sweeney Scientist, Nichols Research Corporation _/
_/ sweeneyb@puzzler.nichols.com (205) 883-1170x1775 _/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/