Alpha
Alpha
- Subject: Alpha
- From: Jeff LaMarche <email@hidden>
- Date: Fri, 26 Jul 2002 21:19:45 -0700
I'm using NSView's dataWithPDFInsideRect on a custom view, like this:
NSData *data = [view dataWithPDFInsideRect:[view bounds]];
NSImage *image = [[NSImage alloc] initWith
Data:data];
This NSImage (image) then gets returned from the method. I futz with the
resolution and size of the NSImage based on some user-entered values and
then get a TIFFRepresentation:
[original setScalesWhenResized:YES];
origSize = [original size];
[original setSize:NSMakeSize([original size].width *
([saveDPIText floatValue] / kScreenResolution),[original size].height *
([saveDPIText floatValue] / kScreenResolution))];
sized = [[[[NSImage alloc] initWith
Data:[original
TIFFRepresentation]] autorelease] setDPI:[saveDPIText floatValue]];
[sized setSize:origSize];
export = [sized TIFFRepresentation];
which I write to a file. I use similar logic when the image is copied to
the pasteboard or dragged. This works great as long as you're only using
Cocoa-based applications or X windows programs like the Gimp, but when
the file is opened in a Carbon app or dragged to a Carbon app, or pasted
into a Carbon app, the image comes over as a big black box.
I'm guessing that this has something to do, perhaps, with the Alpha
settings of the TIFFRepresentation or the NSImage, but am somewhat at a
loss. I've tried a few things, but haven't had any luck in making this
issue go away.
Anyone have any thoughts on this, or experienced something similar? I
half-suspect that there's an obvious one-line fix to this problem, but
I'm durned I can think of it.
Thanks in advance!
- Jeff
_______________________________________________
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.