Log in


For anyone interested in simple graphics in DrScheme...

« previous entry | next entry »
Feb. 26th, 2006 | 03:22 am
posted by: soullesshippy in mctcstudents

I just found some stuff to play with. Look in the Help, in the "Find docs for:" searchbar at the bottom, enter "viewport graphics" to bring up lots of details on DrScheme/PLT's simple graphics library.

here's some starter code to play with.

;include graphics library
(require (lib "graphics.ss" "graphics"))
;start graphics library

;make some constants
(define wid 200)
(define hite 200)

;create a viewport
(define v1 (open-viewport "v1" wid hite))

;draw pixel at x, y, black, or you can use white
;((draw-pixel v1) (make-posn x y)) "black")
;same as above, but use random x, random y
;((draw-pixel v1) (make-posn (random 200) (random 200)) "black")

((draw-pixel v1) (make-posn 100 100) "black")

Link | Leave a comment | Share

Comments {0}