User Tools

Site Tools


putting_20an_20image_20on_20the_20clipboard

This is an old revision of the document!


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.1522502375.txt.gz · Last modified: 2018/03/31 13:19 by 127.0.0.1