• 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
Weird problem with NSBezierpath fill method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird problem with NSBezierpath fill method


  • Subject: Weird problem with NSBezierpath fill method
  • From: Vinay Prabhu <email@hidden>
  • Date: Thu, 9 Nov 2006 17:28:35 +0530
  • Importance: Normal

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Weird problem with NSBezierpath fill method
      • From: Andrew Farmer <email@hidden>
    • Re: Weird problem with NSBezierpath fill method
      • From: "Clint Shryock" <email@hidden>
  • Prev by Date: [Moderator] EOT Re: OT: Where do the UI designers live?
  • Next by Date: How to traverse from one window to another
  • Previous by thread: Re: Intercepting PDF print output
  • Next by thread: Re: Weird problem with NSBezierpath fill method
  • Index(es):
    • Date
    • Thread