• 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 a view and its subviews to an NSImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing a view and its subviews to an NSImage


  • Subject: Re: Drawing a view and its subviews to an NSImage
  • From: Mark Alldritt <email@hidden>
  • Date: Sun, 06 Jun 2004 18:35:44 -0700

> On Jun 6, 2004, at 12:34 PM, Mark Alldritt wrote:
>
>>> NSData *eps = [aView dataWithEPSInsideRect:[aView bounds]];
>>> NSImage *image = [[NSImage alloc] initWithData:eps];
>>>
>>> This produces an image that looks exactly like what you see on the
>>> screen.
>>
>> Thanks for this suggestion. NSVIew's dataWithPDFInsideRect turned out
>> to be
>> the best fit (much better performance since I needed to turn it back
>> into an
>> NSImage right away, and it preserves transparency).
>>
>> The only problem is that these calls are only available on 10.3 or
>> later.
>> Is there another way around this for 10.2?
>
>
> dataWithEPSInsideRect: was in Openstep in 1994 unless I am mistaken.
> dataWithPDFInsideRect was in Mac OS X 10.0 unless I am mistaken.

My apologies.

Searching for these methods in AppKiDo on my 10.2 system came up empty,
leading me to think there were 10.3-only. Looking at the NSView.h header, I
see that these methods are present on 10.2.

Cheers
-Mark

---------------------------------------------------------------------
Mark Alldritt Late Night Software Ltd.
Phone: 250-380-1725 333 Moss Street
FAX: 250-383-3204 Victoria, B.C.
WEB: http://www.latenightsw.com/ CANADA V8V-4M9
_______________________________________________
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: 
 >Re: Drawing a view and its subviews to an NSImage (From: Public Look <email@hidden>)

  • Prev by Date: Re: Copying, hash, and isEqual:
  • Next by Date: Re: Getting Items From MainMenu
  • Previous by thread: Re: Drawing a view and its subviews to an NSImage
  • Next by thread: More on NSTask and output to NSTextView
  • Index(es):
    • Date
    • Thread