Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird problem with NSBezierpath fill method



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


Attachment: BezierFill.zip
Description: Zip compressed data

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.