• 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
Copy Icon Data to clipboard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Copy Icon Data to clipboard


  • Subject: Copy Icon Data to clipboard
  • From: Florian Soenens <email@hidden>
  • Date: Tue, 11 Feb 2003 17:06:08 +0100

Hello,

i'm stuck with the following:

I have an NSImage of 128x128 pixels.
I would like to copy the image to the clipboard, so users can paste it
in the finder's info panel for a specific file.
I tried the following:

//Suppose i have an image ready, called image, with alpha information.

- (IBAction)putImageOnClipBoardAction:(id)sender
{
NSPasteboard *thePasteboard = [NSPasteboard generalPasteboard];
NSData *tiffData;

tiffData = [image TIFFRepresentation];

[thePasteboard declareTypes:[NSArray arrayWithObject:NSTIFFPboardType]
owner:nil];
[thePasteboard setData:tiffData forType:NSTIFFPboardType];
}

This works, except when the icon gets pasted onto a file, it has no
transparency.
The tiff data however, does contains alpha info.

I think i need NSPICTPboardType, but can't figure on how to obtain this
PICT data from my image.

Thanks in advance,
Flor.
_______________________________________________
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.

  • Follow-Ups:
    • Re: Copy Icon Data to clipboard
      • From: David Remahl <email@hidden>
  • Prev by Date: Print Tickets and Cocoa?
  • Next by Date: Re: Copy Icon Data to clipboard
  • Previous by thread: Print Tickets and Cocoa?
  • Next by thread: Re: Copy Icon Data to clipboard
  • Index(es):
    • Date
    • Thread