Re: Problems printing graphics with transparent backgrounds
Re: Problems printing graphics with transparent backgrounds
- Subject: Re: Problems printing graphics with transparent backgrounds
- From: Gideon King <email@hidden>
- Date: Thu, 27 Jun 2002 22:24:20 +0800
I have been trying to find a workaround for this problem, and tried the
following (in Sketch SKTImage drawInView:isSelected: method) in order to
try to generate a non-transparent image with the right image in it:
NSImage *tempImage;
NSBitmapImageRep *tempImageRep;
// Create the image of the background
tempImageRep = [[NSBitmapImageRep alloc]
initWithFocusedViewRect:bounds];
tempImage = [[NSImage alloc] initWithSize:bounds.size];
[tempImage addRepresentation:tempImageRep];
// Draw the image with transparency on it
[tempImage lockFocus];
[image compositeToPoint:NSMakePoint(0, 0)
operation:NSCompositeSourceOver];
[tempImage unlockFocus];
// Put the generated image (with no transparency on it) on the
view
[tempImage compositeToPoint:NSMakePoint(NSMinX(bounds),
NSMaxY(bounds)) operation:NSCompositeSourceOver];
[tempImageRep release];
[tempImage release];
This works fine on when it is displayed, but when I try to print, I get
the following problem:
2002-06-27 22:07:30.661 Sketch[613] PMSessionEndDocumentNoDialog failed
(error code = -30879)
2002-06-27 22:07:30.662 Sketch[613] *** _NSAutoreleaseNoPool(): Object
0x1ade1e0 of class NSCFString autoreleased with no pool in place - just
leaking
2002-06-27 22:07:30.662 Sketch[613] *** _NSAutoreleaseNoPool(): Object
0x214d190 of class NSException autoreleased with no pool in place - just
leaking
2002-06-27 22:07:30.662 Sketch[613] An uncaught exception was raised
2002-06-27 22:07:30.662 Sketch[613] Failed to end PMPrintContext
2002-06-27 22:07:30.663 Sketch[613] *** Uncaught exception:
<NSInternalInconsistencyException> Failed to end PMPrintContext
Sketch has exited with status 255.
Any ideas why?
TIA
Gideon.
On Saturday, June 22, 2002, at 10:01 PM, Gideon King wrote:
I have an application that is able to display graphics and print them -
I just use compositeToPoint: operation:NSCompositeSourceOver to put my
image on a view. I have been testing using PSD images which are
recognized by OS X, and display correctly in the application, and
display correctly in Preview, but when I print them (HP DeskJet 810C -
if it matters), they come out with all the transparent areas black.
I thought I might be somehow screwing things up in my app, so I tried
it in Sketch and got the same results. To reproduce, run Sketch, drag
on a PSD image with some transparency, then print it.
I haven't had a chance to check with other graphic formats which have
transparent backgrounds yet.
Has anyone else encountered this problem? Is there a fix or workaround?
Thanks
Gideon.
_______________________________________________
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.
_______________________________________________
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.