Drawing shadows with graphics class?


#1

Hi,

Is it possible to automatically draw drop shadows on drawn graphics objects? I know you can assign the DropShadowEffect() to components, but what about about Graphics()? If not, I’d like to make an official feature request… :slight_smile:

I would like to be able to do something similar to the Cocoa NSShadow class:

NSShadow* theShadow = [[NSShadow alloc] init];
[theShadow setShadowOffset:NSMakeSize(2.0f, 0.0f)];
[theShadow setShadowBlurRadius:5.0f];
[theShadow setShadowColor:[[NSColor blackColor] colorWithAlphaComponent:0.5f]];
[theShadow set];

// bunch of drawing that now has drop shadow...

[theShadow release];

so it might look like:

DropShadowEffect theShadow();
theShadow.setShadowProperties(5.0f, 0.5f, 2.0f, 0.0f);
g.setShadow(theShadow);  // here is the new bit of code?
g.drawStuff();  // i.e. rectangles, etc

#2

I’ve got some ideas for a new way of handling the drawing code that would allow this kind of thing…


#3

Great! I’ll be looking forward to it…