Copy Icon Data to clipboard
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 set
Data: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.