Thomas Levesque 2/5/2009

[WPF] Paste an image from the clipboard (bug in Clipboard.GetImage)

Read Original

This technical article details a known bug in WPF's Clipboard.GetImage() method, which returns an InteropBitmap that often fails to display. It analyzes the issue, explores suboptimal workarounds, and presents a robust solution by manually retrieving and decoding the DeviceIndependentBitmap (DIB) data from the clipboard, including the necessary steps to reconstruct a valid bitmap file header for successful image loading.

[WPF] Paste an image from the clipboard (bug in Clipboard.GetImage)

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week