ImageMan includes two functions which allow your application to easily place images on the clipboard and retrieve images from the clipboard. These functions are ImgToClipboard and ImgFromClipboard. They're quite simple to use; the following code fragment shows how:
// get an image from the clipboard
if (IsClipboardFormatAvailable(CF_DIB) || IsClipboardFormatAvailable(CF_METAFILEPICT))
hImage = ImgFromClipboard();
.
.
// place the image back on the clipboard
ImgToClipboard(hImage);
.
.
Notice how this fragment verifies that an acceptable format, e.g., CF_DIB or CF_METAFILEPICT, is available. It the application doesn't check for this, ImageMan will simply return a NULL image handle if there's no valid clipboard format available.
© 1995-2004 Data Techniques, Inc. All rights reserved.