• 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
Increasing size of NSImage by adding padding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Increasing size of NSImage by adding padding


  • Subject: Increasing size of NSImage by adding padding
  • From: Glen Simmons <email@hidden>
  • Date: Thu, 21 Oct 2004 11:27:19 -0500

OK, this seems like a really simple thing, but I'm not getting it. I have an NSImage that was created from some 1-bit bitmap data using that really long NSBitmapImageRep initWithBitmapDataPlanes... method. I need to pad the image with a couple of pixels worth of whitespace all the way around.
I tried:
1. create new NSImage that is 4 pixels larger in width and height;
2. lock focus on new image
3. tell original image to compositeToPoint 2,2 (also tried dissolveToPoint and drawAtPoint)

The problem with the above is that I end up with a fuzzy looking image, I guess due to anti-aliasing. I'm guessing (hoping?) there's a much better / cleaner way of doing this so that I end up with the same bitmap, just padded with some whitespace.

Thanks,
Glen Simmons

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Increasing size of NSImage by adding padding
      • From: Nicko van Someren <email@hidden>
  • Prev by Date: Help Help or is there any logic to CFBundleHelpBookName
  • Next by Date: Bindings, Floats, and NSMutableDictionary
  • Previous by thread: Re: Help Help or is there any logic to CFBundleHelpBookName
  • Next by thread: Re: Increasing size of NSImage by adding padding
  • Index(es):
    • Date
    • Thread