• 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 onto NSImageView subclass (Newbie)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing onto NSImageView subclass (Newbie)


  • Subject: Re: Drawing onto NSImageView subclass (Newbie)
  • From: Glen Low <email@hidden>
  • Date: Sun, 8 Feb 2004 13:09:41 +0800

Anyway, I have an NSImageView subclass to which I draw an image (a map
in particular) and then can click to place dots into the view. I have
a method addPoint: which is called during the mouseDown: method. I
have that working correctly. The addPoint method is called, and when
the image does not fill the entire view, the dot shows. But if I click
the image, I can't see the dot, though I presume it is being drawn
under the image.

My question is, how do I draw the dot onto of the image? I plan on
using collections of points to be able to save and retrieve points
between launches, if that makes any difference as to best way of
implementing. I've already searched the archives and tried to find
docs that might help, but to no avail.


I presume you are overriding drawRect: of the NSImageView, and calling the overridden version before doing your drawing?

e.g.

- (void) drawRect: (NSRect) rect
{
[super drawRect: rect];
// do your own drawing of the points here
}

Cheers, Glen Low


---
pixelglow software | simply brilliant stuff
www.pixelglow.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Drawing onto NSImageView subclass (Newbie) (From: Alan Cook <email@hidden>)

  • Prev by Date: Clarification: What is exatly drawing inside a thread
  • Next by Date: Re: Converting wchar_t string to NSString
  • Previous by thread: Drawing onto NSImageView subclass (Newbie)
  • Next by thread: Re: Drawing onto NSImageView subclass (Newbie)
  • Index(es):
    • Date
    • Thread