[plt-scheme] help : White color and "get-pixel" on Viewport graphics.

From: Robby Findler (robby at cs.uchicago.edu)
Date: Mon Apr 14 11:55:01 EDT 2003

Indeed, I do get the result:

  0
  1 1 1 

under macos x with version 203 and the current CVS version. Also, with
the current version under X windows (displaying from a linux machine to
Apple's X11 implementation) I get the above result.

It may well be a problem with the interaction between DrScheme and the
particular X11 that you have. We'll have to look into further and get
back to you.

Robby

At Sun, 13 Apr 2003 00:59:04 -0700 (PDT), "A.Pasquino" wrote:
> Hi,
> 
> thank you for your reply,
> 
> yes I tryied to set the pixel with the 
> (make-rgb 1 1 1) but unfortunatly the result is the
> same.
> 
> My platform is a SuSE Linux 7.0 , I'm using PLT Scheme
> 203.
> 
> Are the RGB values on your system different?
> 
> Alex
> 
> --- Robby Findler <robby at cs.uchicago.edu> wrote:
> >   For list-related administrative tasks:
> >  
> > http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> > 
> > What platofmr are you using? It works correctly for
> > me on macos x.
> > 
> > One thing to try is replacing "white" with:
> > 
> >   (make-rgb 1 1 1)
> > 
> > Does that help?
> > 
> > Robby
> > 
> > At Sat, 12 Apr 2003 12:35:44 -0700 (PDT),
> > "A.Pasquino" wrote:
> > >   For list-related administrative tasks:
> > >  
> > http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> > > 
> > > Hi all ,
> > > 
> > > (this is my first post) 
> > > 
> > > I'm doing some little tests with the Viewport
> > library,
> > > 
> > > I have a little problem at using the "get-pixel"
> > > operation.
> > > 
> > > In particular when I call this function on a white
> > > pixel the result is '1' (but according to the
> > manual
> > > it should be '0'). 
> > > 
> > > I noticed that when I draw a white pixel the
> > values of
> > > the RGB colors are R=248/255 G=84/85 B=248/255,
> > maybe
> > > the "get-pixel" actually tests for a 255/255 R/G/B
> > > value and so it replies 1?
> > > (you can get the same values from an empty window
> > > without drawing a white pixel with the
> > "draw-pixel"). 
> > > 
> > > How can I set a 'true' white in order to get
> > > a 0 from the 'get-pixel' function? 
> > > Maybe I misunderstood how to use these functions? 
> > > Any help is welcome, Thank you in advance.
> > > 
> > > Alex. 
> > > 
> > > PS: thank you to the PLT team for your Great
> > > Environment! 
> > > 
> > > This is my test code: 
> > > 
> > > it should open a 10x10 pixels window and draw a
> > white
> > > pixel in the center, position (4,4)
> > > (actually the "draw-pixel" is not necessary). 
> > > 
> > > (require (lib "graphics.ss" "graphics")) 
> > > (define (test)
> > >   (open-graphics)   
> > > 
> > >   (let ((my-port (open-viewport "rgb-test" 10 10))
> > >         (position (make-posn 4 4)))
> > >     ((draw-pixel my-port) position "white")
> > >     (display ((get-pixel my-port) position))
> > > 
> > >     (let ((pix-color ((get-color-pixel my-port)
> > > position)))
> > >       (newline)
> > >       (display (rgb-red pix-color))(display " ")
> > >       (display (rgb-green pix-color))(display " ")
> > >       (display (rgb-blue pix-color))(display " "))
> > >     (close-viewport my-port)
> > >     )
> > >   (close-graphics)
> > >   )
> > >    
> > > >(test)
> > > 1
> > > 248/255 84/85 248/255
> > > 
> > > __________________________________________________
> > > Do you Yahoo!?
> > > Yahoo! Tax Center - File online, calculators,
> > forms, and more
> > > http://tax.yahoo.com
> > > 
> > 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - File online, calculators, forms, and more
> http://tax.yahoo.com
> 



Posted on the users mailing list.