[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Color Pictures

At 12:14 AM 5/18/94 +0100, teller@capitole.lema.ulg.ac.be wrote:
>I am trying create and draw in a picture (without opening any window),
>and everything is fine except that I couldn't achieve to set the color as I
>want. I could
>however set the pensize (i.e.).
>Does someone know how to do that? Here is the code we use:
>(defun make-picture ()
>   (let ((mypict (#_OpenPicture (mysetrect 0 0 500 500))))
>      (#_forecolor *blue-color*)
>      (jacques-view-draw-contents)
>      (#_closepicture)
>      (write-pict mypict)
>      ))

I believe your problem is a misunderstanding of the #_ForeColor trap.
Its argument has nothing to do with MCL's *xxx-color* variables.
It's argument must be one of #$blackColor, #$whiteColor, #$redColor,
#$greenColor, #$blueColor, #$cyanColor, #$magentaColor, #$yellowColor.
Your best bet would be to use the SET-FORE-COLOR function, which
DOES take an argument in the format of the *xxx-color* variables.
It converts the argument to an RGBColor struct, then uses #_RGBColor
to set the port's color. Your make-picture function should work
if modified as follows (though I haven't tested it):

(defun make-picture ()
   (let ((mypict (#_OpenPicture (mysetrect 0 0 500 500))))
      (set-fore-color *current-view* *blue-color*)
      (write-pict mypict)