vector graphics

Jan Schenkel janschenkel at yahoo.com
Tue Jul 4 14:38:12 EDT 2006


--- Viktoras Didziulis <viktoras at ekoinf.net> wrote:
>  
>  Dear all,
>  
> Are there any good references/tutorials on how to
> handle elementary vector
> graphics in Transcript. What I am trying to do is:
> 1) draw a polyline, polygon or point with unique
> name/ID from coordinates
> stored in tab delimited file as pairs of xy
> coordinates, each vector object
> starting in new line and assign a color to line,
> point or polygon (both line
> and fill);
> 2) change scale - zoom-in or zoom-out,
> 3)save the final vector image in a raster format
> (bmp, gif or png) with
> predetermined resolution, lets say 1024x768 pixels.
>  
> What's the simpliest way of doing this ?
>  
> Best wishes
> Viktoras
>  

Hi Viktoras,

Take a look at the 'graphic' control - style 'polygon'
and its 'points' property. It's a return-delimited
list of points that you can get and set from a
handler.
So depending on the file contents, it could be as easy
as:
--
  put URL("file:" & tFilePath) into tPoints
  set the points of graphic "foobar" to tPoints
--

Setting the points will update the graphic's
rectangle, and vice versa: change the rectangle, and
Revolution will scale it for you - naturally, using
multiples of the original dimensions will work best
;-)

As for rastering, you can use the 'import snapshot' or
'export snapshot' commands, but I'mnot sure how you
can set the resolution. Perhaps some of the
media-oriented people can chime in?

Hope this helped,

Jan Schenkel.

Quartam Reports for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the use-livecode mailing list