Re: How to draw whole NSImage inside custom rect in NSView
Re: How to draw whole NSImage inside custom rect in NSView
- Subject: Re: How to draw whole NSImage inside custom rect in NSView
- From: Alexander Shmelev <email@hidden>
- Date: Wed, 12 Nov 2008 02:01:06 +0300
Yes, it is called outside my custom preview code. And values of
maxScanArea, [self bounds] are correct.
Also if I replace [image drawInRect:...] with solid color fill
[NSBezierPath fillRect:maxScanArea], everything works as I expect.
On 12.11.2008, at 1:53, Andy Lee wrote:
On Nov 11, 2008, at 5:17 PM, Alexander Shmelev wrote:
- (void) drawRect:(NSRect)rect
{
// Drawing image in preview
if (image) {
NSRect imageRect;
imageRect.origin = NSZeroPoint;
imageRect.size = [image size];
[image drawInRect:maxScanArea
fromRect:imageRect
operation:NSCompositeSourceOver
fraction:1];
// I want image to be drawn in maxScanArea rect, but it is drawn
in [self bounds] rect.
}
}
I don't see a -setPreviewWidth:height: message anywhere. Have you
confirmed that it is indeed called? I would put a breakpoint in
both -setPreviewWidth:height: and -drawRect: and make sure the
values of maxScanArea and bounds are what you expect.
--Andy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden