Setting Pixels

Jim Hurley jhurley at infostations.com
Tue Jan 28 18:15:01 EST 2003


>
>Recently, "Robert J Warren (Howsoft.com)"  wrote:
>
>>  All I want to do is something which is as easy as falling off a log in VB. I
>>  want to move the mouse around a window (over an image perhaps, but not
>>  necessarily) and to draw a line of pixels as I go - i.e. construct a very
>  > primitive drawing program. I would be grateful if anyone could help.
>
>Sounds like you could simply use the paint tools and an image object
>overlaying whatever you want to draw on.  See the docs under choosing tools
>("choose" command) and:
>- pencil
>- brush
>- spray can
>- bucket
>
>Alternatively, you could use draw graphics, using the curve tool for
>free-form drawing, or primitive shapes and polygons, but this can create
>multiple objects, depending on how you implement it.
>
>Hopefully there's something here you can use.
>
>Regards,
>
>Scott Rossi
>Creative Director
>Tactile Media, Multimedia & Design


Robert,

Just to add a bit to Scott's good advice:

If you would like some tools to facilitate this kind of  drawing, the 
ideal is Turtle Graphics. You can control the turtle (drawing cursor) 
with such simple commands as:

Relative tools (independent of a coordinate system): Forward,Back, 
Left, Right, setHeading, etc.
Absolute tools (coordinate based):  setXY,  incrementXY, 
xyCoordinates(), xCor() etc. .


The good people at RR have posted a demo stack in the "Education" 
page on the RunRev site:

http://www.runrev.com/revolution/education/usercontributions.html

Check the User Contributions. This is intended primarily for an 
elementary course in programing in  Transcript  and Turtle Graphics 
for science students, but it may  also work for you.

Jim Hurley



More information about the use-livecode mailing list