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

Re: Copy Icon Data to clipboard


  • Subject: Re: Copy Icon Data to clipboard
  • From: David Remahl <email@hidden>
  • Date: Tue, 11 Feb 2003 17:14:55 +0100

Florian,

Icon data on the clipboard is not stored as TIFF. It is stored as
actual icns data.

The Cocoa wrapper for Icon Services, IconFamily has some functionality
to support putting and getting icons to/from the clipboard.

<http://homepage.mac.com/troy_stephens/software/objects/IconFamily/
content.html>

@interface IconFamily (ScrapAdditions)
+ (BOOL) canInitWithScrap;
+ (IconFamily*) iconFamilyWithScrap;
- initWithScrap;
- (BOOL) putOnScrap;
@end

Oh, and please avoid cross-posting :-).

/ Regards, David Remahl

> 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.

References: 
 >Copy Icon Data to clipboard (From: Florian Soenens <email@hidden>)

  • Prev by Date: Copy Icon Data to clipboard
  • Next by Date: RTFD File Encoding
  • Previous by thread: Copy Icon Data to clipboard
  • Next by thread: RTFD File Encoding
  • Index(es):
    • Date
    • Thread