# Copy a picture to the Clipboard

**URL:** <https://forum.xojo.com/t/copy-a-picture-to-the-clipboard/10004>\
**Category:** Targets\
**Created:** [August 1, 2013, 3:55pm UTC](https://forum.xojo.com/t/copy-a-picture-to-the-clipboard/10004 "2013-08-01T15:55:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_D](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_d/32/266_2.png) [@Mike\_D](https://forum.xojo.com/u/Mike_D)\
**Post date:** [August 1, 2013, 3:55pm UTC](https://forum.xojo.com/t/copy-a-picture-to-the-clipboard/10004/1 "2013-08-01T15:55:58Z")

</div>

What are the “best practices” for copying a picture (and its folderItem) to the clipboard?

I’m thinking something like this, but I don’t know what’s the “proper” way to do it:

```auto
        dim c as new Clipboard
        c.text = f.URLPath
        c.addRawData f.URLPath, "public.url"
        c.Picture = f.OpenAsPicture
        c.close
```

I’m guessing this is not the way to do it for Windows, though.

Any ideas?

---

<div class="post-metadata">

**Author:** ![Bob\_Keeney](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/54ee81/32.png) [@Bob\_Keeney](https://forum.xojo.com/u/Bob_Keeney)\
**Post date:** [August 2, 2013, 3:09pm UTC](https://forum.xojo.com/t/copy-a-picture-to-the-clipboard/10004/2 "2013-08-02T15:09:00Z")

</div>

Honestly, I don’t know. It’s a good question that I’ve not had to answer in 12+ years of Real Studio/Xojo development.

I would test it in Windows and if it works then you’re good. If it doesn’t then perhaps conditional compiling with #if #then #else is required. Kind of curious on what the results are.

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [August 4, 2013, 7:04am UTC](https://forum.xojo.com/t/copy-a-picture-to-the-clipboard/10004/3 "2013-08-04T07:04:25Z")

</div>

Looks good to me, but as for Windows, I don’t even know if there is a standard for files on the clipboard. But c.picture will do it.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 4:47pm UTC](https://forum.xojo.com/t/copy-a-picture-to-the-clipboard/10004/4 "2020-10-29T16:47:05Z")

</div>


