• 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
Drawing views into NSImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drawing views into NSImage


  • Subject: Drawing views into NSImage
  • From: "Geert B. Clemmensen" <email@hidden>
  • Date: Mon, 4 Apr 2005 08:27:37 +0200

Hello,

I have N views (or more specifically, N subviews of a content view that holds M subviews with M >= N). I want to draw these N views into an NSImage. I calculate the proper rect and initializes an NSImage instance accordingly, i.e. its size matches that of the calculated rect. I then do:

[myImage lockFocus];
// fill the image with clearColor
// draw the N views via drawRect: calls
[myImage unlockFocus];

This kinda works, i.e. I get an NSImage that almost looks right, but I haven't been able to consistently have the N views draw so their relative position to each other is kept. I have tried enough variants of NSAffineTransform with -concat/-set (with and without save/restoreGraphicsState) to realize that this may not be the way to go. What is the recommended/preferred way to change the coordinate system before each call to drawRect:?

I believe I have googled and otherwise searched the topic quite extensively, but haven't yet found a solution. Any pointers will be highly appreciated.

Regards,
Geert B. Clemmensen
www.frontbase.com

 _______________________________________________
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: Drawing views into NSImage
      • From: "John C. Randolph" <email@hidden>
    • Re: Drawing views into NSImage
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Re: Cocoa coding style : How to refer to a document
  • Next by Date: Re: Cocoa-dev Digest, Vol 2, Issue 452
  • Previous by thread: Re: Cocoa coding style : How to refer to a document
  • Next by thread: Re: Drawing views into NSImage
  • Index(es):
    • Date
    • Thread