• 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: Scott Herz <email@hidden>
  • Date: Mon, 8 Oct 2001 13:02:25 -0700

I'm not on the CG team, but be prepared for this not to work in an upcoming version of 10.

Scott.

On Sunday, October 7, 2001, at 03:39 AM, Finlay Dobbie wrote:

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
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


  • Follow-Ups:
    • Re: Quartz call to generate shadows?
      • From: Finlay Dobbie <email@hidden>
References: 
 >Re: Quartz call to generate shadows? (From: Finlay Dobbie <email@hidden>)

  • Prev by Date: Re: Cocoa newbie frustration
  • Next by Date: NSImageView contents size?
  • Previous by thread: Re: Quartz call to generate shadows?
  • Next by thread: Re: Quartz call to generate shadows?
  • Index(es):
    • Date
    • Thread