• 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: Draw a single bitmap multiple times into an NSView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Draw a single bitmap multiple times into an NSView?


  • Subject: Re: Draw a single bitmap multiple times into an NSView?
  • From: Andy Lee <email@hidden>
  • Date: Mon, 27 Mar 2006 19:09:16 -0500

On Mar 25, 2006, at 9:36 PM, patrick wrote:
I'm trying to figure out the most efficient method for drawing a
bitmap image multiple times into an NSView. For example, I'd like to
load in a bitmap image from disk, and draw it repeatedly to a grid. It
doesn't seem like copying NSImage objects and repeatedly add them into
the view is particularly optimal.

By "copying NSImage objects [etc.]" do you mean creating NSImageViews and adding them as subviews? Note that NSImage is not the same as NSImageView.


You can create just one NSImage and draw it multiple times using either -drawAtPoint:fromRect:operation:fraction: or - drawInRect:fromRect:operation:fraction:. You would do this in the - drawRect: method of your NSView, assuming you're using your own custom NSView subclass.

--Andy

_______________________________________________
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


References: 
 >Draw a single bitmap multiple times into an NSView? (From: patrick <email@hidden>)

  • Prev by Date: Student membership
  • Next by Date: Re: CustomView that forwards mouse events to lower views?
  • Previous by thread: Re: Draw a single bitmap multiple times into an NSView?
  • Next by thread: Re: Draw a single bitmap multiple times into an NSView?
  • Index(es):
    • Date
    • Thread