• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Quartz call to generate shadows?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quartz call to generate shadows?


  • Subject: Re: Quartz call to generate shadows?
  • From: Finlay Dobbie <email@hidden>
  • Date: Sun, 7 Oct 2001 11:39:12 +0100

On Sunday, October 7, 2001, at 06:12 am, John C. Randolph wrote:

> Does anyone know how to get hold of Quartz's code for generating
> shadows around windows? I'd like to create shadows from bitmaps using
> the same algorithm.

There is a way of setting shadowing on the current graphics context, but
for some reason it's private. This is how ASM does it:

// private SPI function definitions into the CoreGraphics framework
extern void *CGSReadObjectFromCString(char*);
extern char *CGSUniqueCString(char*);
extern void *CGSSetGStateAttribute(void*,char*,void*);
extern void *CGSReleaseGenericObj(void*);
void *r27, *r29;

[NSGraphicsContext saveGraphicsState];
r27 = CGSReadObjectFromCString("{ Style = Shadow; Height = 2;
Radius = 2; Azimuth = 90; Ka = 0.6; }");
r29 = [[NSGraphicsContext currentContext] graphicsPort];
CGSSetGStateAttribute(r29, CGSUniqueCString("Style"), r27);

<< do drawing >>

[NSGraphicsContext restoreGraphicsState];
CGSReleaseGenericObj(r27);

-- Finlay


  • Follow-Ups:
    • Re: Quartz call to generate shadows?
      • From: Scott Herz <email@hidden>
References: 
 >Quartz call to generate shadows? (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Re: Well, isn't this tantalizing?
  • Next by Date: Re: Undo in a Sheet -- no takers?
  • Previous by thread: Quartz call to generate shadows?
  • Next by thread: Re: Quartz call to generate shadows?
  • Index(es):
    • Date
    • Thread