Re: Quartz call to generate shadows?
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