Portable Network Graphics format
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