Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Can't paste images from Snip & Sketch #779
Comments
|
It also fails with other UWP apps such as Windows Mail or Paint 3D since the common UWP DataPackage::SetBitmap() method doesn't mark the bitmap as a DIB. |
|
It works with the Photos app only because Photos also puts the image file reference in the clipboard. |


Trying to paste an image from Snip & Sketch (the Snipping Tool replacement from Windows 10 October 2018 Update aka RS5) results in nothing happening.
Looking through the code I found this to be the root cause - ImageData is only created if there's a DIB in the clipboard. It does work with the Photos app because that one also puts an image file in the clipboard, which OLW is able to treat as image content, but it seems like it wouldn't work with most modern (UWP) apps that just call the standard DataPackage::SetBitmap()
It starts working correctly if I change it to:
public static ImageData Create(IDataObject iDataObject)
{
if (!OleDataObjectHelper.GetDataPresentSafe(iDataObject, DataFormats.Dib) &&
!OleDataObjectHelper.GetDataPresentSafe(iDataObject, DataFormats.Bitmap) &&
!OleDataObjectHelper.GetDataPresentSafe(iDataObject, DataFormats.EnhancedMetafile))
return null;
else
return new ImageData(iDataObject);
}
Really though - it should check for all supported image types before giving up.