• 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
Re: How to draw whole NSImage inside custom rect in NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How to draw whole NSImage inside custom rect in NSView (From: Alexander Shmelev <email@hidden>)
 >Re: How to draw whole NSImage inside custom rect in NSView (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: A bit of a dumb question, but I need to know...
  • Next by Date: Re: A bit of a dumb question, but I need to know...
  • Previous by thread: Re: How to draw whole NSImage inside custom rect in NSView
  • Next by thread: A bit of a dumb question, but I need to know...
  • Index(es):
    • Date
    • Thread