• 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
NSImage size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSImage size


  • Subject: NSImage size
  • From: Dan Huntsinger <email@hidden>
  • Date: Sun, 25 Nov 2001 01:08:39 -0800

Hi everybody,

Another quick question:

I am trying to display an image in my NSView sublcass, and here's the code I
have for the drawRect method so far:

- (void)drawRect:(NSRect)rect
{
NSString *title;
NSImage *image;

title = [[NSBundle mainBundle] pathForImageResource:@"aTiffImage"];
image = [[NSImage alloc] initWithContentsOfFile:title];
[image setSize:NSMakeSize(100,150)];
[image compositeToPoint:NSMakePoint(0,0) fromRect:rect
operation:NSCompositeCopy fraction:1.0];
}

No matter what I do, I keep getting a "little" image displayed, instead of
the actual bigger size of the image, or the image size I set. Why doesn't
the setSize: method work in the above code?

Thanks,
Dan


  • Follow-Ups:
    • Re: NSImage size
      • From: Tom Waters <email@hidden>
  • Prev by Date: larger Drawer
  • Next by Date: Re: buddy windows
  • Previous by thread: Re: sheets from the Side
  • Next by thread: Re: NSImage size
  • Index(es):
    • Date
    • Thread