Re: Drawing shadows?
Re: Drawing shadows?
- Subject: Re: Drawing shadows?
- From: Nathan Day <email@hidden>
- Date: Thu, 31 Jan 2002 23:54:20 +1030
I've created a category of NSBitmapImageRep that allows you to do
convolution with another NSBitmapImageRep, you pass it an image that
represents what you would want to happen to a single white pixel, ie a
single white pixel surrounded a big alpha channel smear and it applies
it to ever pixel in your image. It also contains a method for creating
an image from an array of float. I've use it to create shadows around
text like the floating text in the dock. You can play around with it if
you like but it still a bit of a work in progress, there is no
documentation and I have only tested it with a convolution between a
RBGA image and a two plane white and alpha image both 8bit per channel,
the white channel is treated as the RBG channels all with the same
values. Look in my iTool home page
http://homepage.mac.com/nathan_day/
On Tuesday, January 29, 2002, at 12:42 PM, Clyde McQueen wrote:
Is there a magic Cocoa API to draw the nifty shadows around objects? Or
should I start measuring gray values?
Btw, NSImageView setImageFrameStyle:NSImageFramePhoto doesn't quite do
the trick. The default NSImageFrameGrayBezel "sunken look" is the right
idea, except that I want to put the shadow around an arbitrary object.