Re: Weird problem with NSBezierpath fill method
Re: Weird problem with NSBezierpath fill method
- Subject: Re: Weird problem with NSBezierpath fill method
- From: "Clint Shryock" <email@hidden>
- Date: Thu, 9 Nov 2006 07:48:27 -0600
does the fill method do nothing or is it filling inside the path but not the
path itself?
The fill method does not fill the path, it fills the enclosed region up to
the path. see here<http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSBezierPath_Class/Reference/Reference.html#//apple_ref/occ/instm/NSBezierPath/fill>
"The painted region includes the pixels right up to, but not including, the
path line itself"
hope that helps
On 11/9/06, Vinay Prabhu <email@hidden> wrote:
Hi,
I have encountered a strange problem with the NSBezierPath's, fill method.
The "fill" method will not fill the path with the current color set.
The code is like this,
//m_pInnerOutline is the object of class NSBezierPath
NSSize aSize;
aSize.width = m_uiWidth; //Width of the image
aSize.height = m_uiHeight; //Height of the image
NSImage* drawImage = nil;
drawImage = [[NSImage alloc] initWithSize:aSize];
NSRect fillRect = NSMakeRect(0, 0, aSize.width, aSize.height);
[drawImage lockFocus];
[[NSColor colorWithCalibratedRed:0 green:0 blue:0 alpha:0] set];
NSRectFill(fillRect);
[[NSColor colorWithCalibratedRed:1 green:0 blue:1 alpha:1] set];
[m_pInnerOutline setLineWidth:2];
[m_pInnerOutline setWindingRule:NSEvenOddWindingRule];
[m_pInnerOutline stroke]; //This method works
[m_pInnerOutline fill]; //This method doesn't works
[drawImage unlockFocus];
The "stroke" method works fine, but the "fill" method will not work.
I had saved the drawImage as tif image and attached with the mail.
I am not understanding why "fill" method is not working !!!!
If bezier path contains only rectangle, the fill method works fine.
Does anybody know what is causing this problem? or anything wrong in the
code?
Regards
Vinay
_______________________________________________
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
_______________________________________________
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