c++ - How do you copy/paste image data? -
using c++ , winapi, how copy image data pre-loaded image clipboard?
you need create object implements idataobject, , place on clipboard using olesetclipboard.
when place data in clipboard have ability specify multiple formats. application reading clipboard can enumerate formats , decide 1 use.
there quite few "standard" clipboard formats (with known constant values), e.g.:
cf_bitmap: handle bitmap (hbitmap).cf_dib: memory object containing bitmapinfo structure followed bitmap bits.cf_dibv5: memory object containing bitmapv5header structure followed bitmap color space information , bitmap bits.
you can register custom formats using registerclipboardformat. office exposes images number of different formats they've registered, e.g.:
dword cf_png = registerclipboardformat("png"); dword cf_jfif = registerclipboardformat("jfif"); dword cf_gif = registerclipboardformat("gif"); dword cf_enhmetafile = registerclipboardformat("cf_enhmetafile"); dword cf_metafilepict = registerclipboardformat("cf_metafilepict ");
Comments
Post a Comment