• 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
Alpha
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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] initWithData: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] initWithData:[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.

  • Prev by Date: [OT] Case-preserving filesystems (was: Re: FYI: Objective-C++)
  • Next by Date: Fwd: Creating Parent and Child CFXMLNodesRefs
  • Previous by thread: [OT] Case-preserving filesystems (was: Re: FYI: Objective-C++)
  • Next by thread: Fwd: Creating Parent and Child CFXMLNodesRefs
  • Index(es):
    • Date
    • Thread