• 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
Copying an image file to pasteboard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Copying an image file to pasteboard


  • Subject: Copying an image file to pasteboard
  • From: Jeremy Dronfield <email@hidden>
  • Date: Mon, 2 Aug 2004 20:56:23 +0100

This question is so basic I can't even believe I'm having to ask it; but I can't find anything in the docs or archives, so here goes.

In the Finder, select an image file and hit Command-C to copy it, then open TextEdit and hit Command-V. The image is pasted in. Saving and opening the RTFD package, you will find that the image attachment inside has the title of the original image. Fine. So how was that image written to the pasteboard by the Finder? I have an application in which I want to be able to place images on the pasteboard for pasting into other apps. However, the only way I can get a pastable image onto the pasteboard is by doing [pboard setData:[image TIFFRepresentation] forType:NSTIFFPboardType]. This is clearly not the same thing. I've tried:

[pboard setPropertyList:[NSArray arrayWithObject:filePath] forType:NSFilenamesPboardType]

and

[pboard writeFileContents:filePath]

and creating a file wrapper from the file and using,

[pboard writeFileWrapper:wrapper]

and various combinations of these. None of them work. Can someone please tell me what I'm missing here?

Regards,
-Jeremy
_______________________________________________
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: Copying an image file to pasteboard
      • From: Ricky Sharp <email@hidden>
    • Re: Copying an image file to pasteboard
      • From: j o a r <email@hidden>
  • Prev by Date: Re: Custom Field Editors
  • Next by Date: Re: Copying an image file to pasteboard
  • Previous by thread: Re: CGImage and NSBitmapImageRep
  • Next by thread: Re: Copying an image file to pasteboard
  • Index(es):
    • Date
    • Thread