Popular Tags

Who's online

There are currently 0 users and 71 guests online.

User login

There's a neat new function in Leopard called NSDrawNinePartImage. Basically it draws an image from nine different parts (top left, top middle, top right, left, middle, right, and bottom left, bottom middle, and bottom right). The cool thing about it is that you can use it to draw images of arbitrary width and height that scales only the middle portion.

Why is this cool? Well, perhaps you want to draw an ImageWell-like control. The border around the ImageWell remains constant, no matter its size. It's the middle portion that scales. This is exactly what NSDrawNinePartImage does. You define the border images, and then it scales the middle image to fill whatever's left (basically).

Unfortunately, there's not too much documentation on it. However, there's a really great post over at www.karlkraft.com on how to use NSDrawNinePartImage. You can check it out here: http://www.karlkraft.com/index.php/2007/11/14/nsdrawninepartimage/

No votes yet



The site has recently been updated. You may notice some of the following issues:

  • Some URLs no longer work. Please use the search box.
  • File uploads should now be working. If you experience problems, please contact us.