[plt-scheme] Graphics artifacts

From: Jaime Vargas (jev at mac.com)
Date: Wed Nov 19 10:08:33 EST 2008

When running the code below in OSX 10.4.11 and 10.5.4 using DrScheme 4.1.2.4-svn12nov2008, I see white bands defects. Is this normal for rendering pixel by pixel or a bug?

#lang scheme/gui

; Make a 300 x 300 frame
(define frame (new frame% [label "Drawing Example"]
                   [width 300]
                   [height 300]))
; Make the drawing area
(define canvas (new canvas% [parent frame]))
; Get the canvas's drawing context
(define dc (send canvas get-dc))
; Make some pens and brushes
(define black-pen (make-object pen% "BLACK" 1 'solid))
(define red-pen (make-object pen% "RED" 1 'solid))
; Show the frame
(send frame show #t)
; Wait a second to let the window get ready
(sleep/yield 1)  
; Draw 1-pixel checkerboard pattern
(for* ([x (in-range 300)]
       [y (in-range 300)])
  (if (odd? (+ x y))
      (send dc set-pen red-pen)
      (send dc set-pen black-pen))
  (send dc draw-point x y))

Thanks,

Jaime


Posted on the users mailing list.