Bitmaps created using pict->bitmap look pixelated to me on screen (on Mac
OS in "Retina" mode, which I suspect might be relevant). I initially
discovered this when using picts as labels for message% instances like this:

#lang racket/gui

(require pict)

(define f
  (new frame%
       [label "Example"]))

(new message%
     [parent f]
     [label (pict->bitmap (disk 100))])


(new canvas%
     [parent f]
     [style '(transparent)]
     [min-width 100]
     [min-height 100]
     [paint-callback (λ (c dc)
                       (draw-pict (colorize (disk 100) "green")
                                  dc
                                  0
                                  0))])
(send f show #t)


The black disk in the above is pixelated for me, while the green one drawn
on a canvas looks normal.

I also noticed as I was writing this that evaluating (pict->bitmap (disk
100)) in the DrRacket REPL produces a pixelated result compared to
evaluating (disk 100).

Is there either a way to avoid this in general, or else a recommended way
to do the equivalent of using picts for message% labels in particular? (I
suppose I could subclass canvas% …)

Thanks,
Philip

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to