Lisp HUG Maillist Archive

Patterns in graphics state

Does anyone have some example code for how patterns are used with
graphics-state objects in the CAPI?  In section 12.3 of the CAPI User
Guide it says that the pattern should be a "pixmap" which is not
defined as far as I can see.  Is a "pixmap" the same as a "pixmap
port", i.e. do I create the pattern with operations like
CREATE-PIXMAP-PORT?  Or do I specify/load external images which are
then used as patterns?

FWIW, I'm currently only interested in a simple "gray" pattern.

Thanks,
Edi.


Re: Patterns in graphics state

On Saturday 26 January 2008 8:28:21 pm Edi Weitz wrote:
> Does anyone have some example code for how patterns are used with
> graphics-state objects in the CAPI?  In section 12.3 of the CAPI User
> Guide it says that the pattern should be a "pixmap" which is not
> defined as far as I can see.  

> Is a "pixmap" the same as a "pixmap 
> port", 

Yes.

> i.e. do I create the pattern with operations like 
> CREATE-PIXMAP-PORT?  Or do I specify/load external images which are
> then used as patterns?

Yes to both.

You can also "inline" the image bits - see the example of *do-button* in 
buttons/buttons.lisp.  This example makes me think that you could generate 
the gray pattern programmatically (stupid question - why is it not sufficient 
to use :background :gray?).


pt


Re: Patterns in graphics state

On Mon, 28 Jan 2008 11:05:19 -0500, Paul Tarvydas <tarvydas@visualframeworksinc.com> wrote:

>> Is a "pixmap" the same as a "pixmap port",
>
> Yes.
>
>> i.e. do I create the pattern with operations like
>> CREATE-PIXMAP-PORT?  Or do I specify/load external images which are
>> then used as patterns?
>
> Yes to both.
>
> You can also "inline" the image bits - see the example of
> *do-button* in buttons/buttons.lisp.

Ah, OK.  I've done that before to include external images directly
into an executable, but it wasn't clear to me that this applies to
patterns as well.

> This example makes me think that you could generate the gray pattern
> programmatically (stupid question - why is it not sufficient to use
> :background :gray?).

No, that's not a stupid question.  I just don't know the answer... :)

(You really mean background?  Or rather foreground?)

Is a gray pattern really always equivalent to using gray as a color?
That would at least solve my specific case, I think.

Besides, only after posting my question I found out that patterns
aren't available on Windows anyway.  D'oh!  But nevertheless, I'm
interested to know how they are used.  (Actually, I'm also surprised
they're not available on Windows.  ISTR that patterns are used for
drawing in an old edition of Petzold's book, but maybe I'm wrong.)

Thanks,
Edi.


Updated at: 2020-12-10 08:44 UTC