• 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: Drawing inside an NSImage?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing inside an NSImage?


  • Subject: Re: Drawing inside an NSImage?
  • From: Markus Spoettl <email@hidden>
  • Date: Mon, 09 Mar 2015 08:20:13 +0100

On 09/03/15 00:12, Patrick J. Collins wrote:
           [_image lockFocus];
           [[NSColor blueColor] set];
           NSBezierPath *line = [NSBezierPath bezierPath];

           NSPoint pointA = NSMakePoint(0, 0);
           NSPoint pointB = NSMakePoint(self.bounds.size.width, 0);

           [line moveToPoint:pointA];
           [line lineToPoint:pointB];
           [line stroke];

What am I doing wrong here?

If that's your real code, you need to call [_image unlockFocus] after you are done painting the content of the image to balance the call to -lockFocus.

Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________

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: 
 >Drawing inside an NSImage? (From: "Patrick J. Collins" <email@hidden>)

  • Prev by Date: Re: Trying to create a 1px width NSBox
  • Next by Date: Document based architecture
  • Previous by thread: Re: Drawing inside an NSImage?
  • Next by thread: Document based architecture
  • Index(es):
    • Date
    • Thread