• 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: email@hidden
  • Date: Thu, 21 Feb 2002 13:19:27 -0800

I found this thread in the archives from October of last year... Scott implied that John Geleynse from Apple would have some input on how to draw shadows properly in the future... Has anything constructive happened on this front in the last four months?

I have written a clone of NSProgressIndicator that is a subclass of NSControl and uses an NSCell subclass for drawing, so it is easier to integrate into NSTableView... it is identical, except for the shadow... so I'd love it if there was a blessed way to draw these...


On Monday, October 8, 2001, at 11:02 PM, Scott Herz wrote:

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
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

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

  • Prev by Date: Re: NSImageCell and NSTableView
  • Next by Date: RE: Info.plist
  • Previous by thread: Re: NSSliderCell private variables
  • Next by thread: Re: Quartz call to generate shadows?
  • Index(es):
    • Date
    • Thread