• 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
Portable Network Graphics format
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Portable Network Graphics format


  • Subject: Portable Network Graphics format
  • From: Todd Heberlein <email@hidden>
  • Date: Fri, 10 Aug 2001 18:46:33 -0700

I am trying to extract and save a PNG image from a NSView subclass (in the
example below, display_box is an NSBox). I have used the basic code below
(minus error checking), but I get the following error message logged to the
debug window:

"PNG writer requires compacted components (bits/component * components/pixel
= bits/pixel)"

I have no idea how to address this. The "properties:" value in the last
method call is an NSDictionary, but I don't know what to put in it (hence I
passed a nil pointer).

p_pdf_data = [display_box dataWithPDFInsideRect: [display_box bounds]];
p_bitmap = [NSBitmapImageRep imageRepWithData: p_pdf_data];
p_png_data = [p_bitmap representationUsingType: NSPNGFileType
properties: nil];


Unfortunately, the documentation for the representationUsingType:properties:
method only says "Description forthcoming."

Anyone have a recommendation?

Thanks,

Todd

--------------
Todd Heberlein
email@hidden
530-758-4338


  • Prev by Date: Re: newbie question on contextual menus
  • Next by Date: NSArchiver
  • Previous by thread: Simple Control Help
  • Next by thread: Re: Portable Network Graphics format
  • Index(es):
    • Date
    • Thread