NSImage size
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