User Tools

Site Tools


Putting an image on the clipboard

by Richard Russell, March 2012

Putting an image on the clipboard is straightforward:

        cx% = 0
        cy% = 0
        hbitmap% = FNloadimage(pic$, cx%, cy%, 0)
        SYS "OpenClipboard", @hwnd%
        SYS "EmptyClipboard"
        SYS "SetClipboardData", CF_BITMAP, hbitmap%
        SYS "CloseClipboard"

Here pic$ is the full path and filename to the image file (which can be a BMP, EMF, GIF, ICO, JPEG or WMF). If you want to support a wider range of formats (including PNG and TIFF) then call FNloadimagegdip or FNloadimagegdip2 rather than FNloadimage.

This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information
putting_20an_20image_20on_20the_20clipboard.txt · Last modified: 2018/04/13 16:54 by richardrussell