The system implicitly converts data between certain clipboard formats: if a window requests data in a format that is not on the clipboard, the system converts an available format to the requested format. The system can convert data as indicated in the following table.
Clipboard Format | Conversion Format | Platform Support |
---|---|---|
CF_BITMAP | CF_DIB | Windows NT, Windows 95, Windows 98 |
CF_BITMAP | CF_DIBV5 | Windows NT 5.0 |
CF_DIB | CF_BITMAP | Windows NT, Windows 95, Windows 98 |
CF_DIB | CF_PALETTE | Windows NT, Windows 95, Windows 98 |
CF_DIB | CF_DIBV5 | Windows NT 5.0 |
CF_DIBV5 | CF_BITMAP | Windows NT 5.0 |
CF_DIBV5 | CF_DIB | Windows NT 5.0 |
CF_DIBV5 | CF_PALETTE | Windows NT 5.0 |
CF_ENHMETAFILE | CF_METAFILEPICT | Windows NT, Windows 95, Windows 98 |
CF_METAFILEPICT | CF_ENHMETAFILE | Windows NT, Windows 95, Windows 98 |
CF_OEMTEXT | CF_TEXT | Windows NT, Windows 95, Windows 98 |
CF_OEMTEXT | CF_UNICODETEXT | Windows NT |
CF_TEXT | CF_OEMTEXT | Windows NT, Windows 95, Windows 98 |
CF_TEXT | CF_UNICODETEXT | Windows NT |
CF_UNICODETEXT | CF_OEMTEXT | Windows NT |
CF_UNICODETEXT | CF_TEXT | Windows NT |
If the system provides an automatic type conversion for a particular clipboard format, there is no advantage to placing the conversion format(s) on the clipboard.
If the system provides an automatic type conversion for a particular clipboard format, and you call EnumClipboardFormats to enumerate the clipboard data formats, the system first enumerates the format that is on the clipboard, followed by the formats to which it can be converted.
When copying bitmaps, it is best to place the CF_DIB or CF_DIBV5 format on the clipboard. This is because the colors in a device-dependent bitmap (CF_BITMAP) are relative to the system palette, which may change before the bitmap is pasted. If the CF_DIB or CF_DIBV5 format is on the clipboard and a window requests the CF_BITMAP format, the system renders the device-independent bitmap (DIB) using the current palette at that time.
If you place the CF_BITMAP format on the clipboard (and not CF_DIB), the system renders the CF_DIB or CF_DIBV5 clipboard format as soon as the clipboard is closed. This ensures that the correct palette is used to generate the DIB. If you place the CF_DIBV5 format with the bitmap color space information in the clipboard, the system will convert the bitmap bits from the bitmap color space to the sRGB color space when CF_DIB or CF_DIBV5 is requested. If CF_DIBV5 is requested when there is no color space information in the clipboard, the system returns sRGB color space information in the BITMAPV5HEADER structure. Conversions between other clipboard formats occur upon demand.
If the clipboard contains data in the CF_PALETTE format, the application should use the SelectPalette and RealizePalette functions to realize any other data in the clipboard against that logical palette.
There are two clipboard formats for metafiles: CF_ENHMETAFILE and CF_METAFILEPICT. Specify CF_ENHMETAFILE for enhanced metafiles and CF_METAFILEPICT for Windows metafiles.