• 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: Drawing shadow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing shadow


  • Subject: Re: Drawing shadow
  • From: Youngjin Kim <email@hidden>
  • Date: Sun, 17 Jun 2001 00:47:50 +0900

I'm following up my own thread. At first, I tried with trasparent tiff
image, but it wasn't flexible enough to use.


// draw shadow
if(hilited)
{
[path setLineJoinStyle:NSRoundLineCapStyle];
[[NSColor colorWithCalibratedRed:0.0 green:0.0 blue:0.0
alpha:0.1] set];
for (i=0;i<10;i+=2)
{
[path setLineWidth:i*2];
[path stroke];
}
}
// draw your object over it
...


The idea is simple. Set the line join style to round so that shadow of
angled corners to be rendered smoothly then storke it in varied widths,
translucent black color. To get more realistic look, the path for
shadow should be placed little lower from original position.

This worked for me.

Youngjin


  • Prev by Date: Re: WWDC Dev Tools / Software update
  • Next by Date: Re: WWDC Dev Tools / Software update
  • Previous by thread: Re: Drawing shadow
  • Next by thread: Checkboxes and NSBox titles
  • Index(es):
    • Date
    • Thread