Downloading and extracting http://www.nirsoft.net/utils/nircmd-x64.zip makes the function
copy = (Export["C:\\nircmd\\asd.png", #];
RunProcess[{"C:\\nircmd\\nircmdc.exe",
"clipboard", "copyimage", "\"C:\\nircmd\\asd.png\""}];) &;
copy images from mathematica (as well as everything that exports properly as PNG), and I get the same correct result when pasting in all my programs.
When using RunProcess
no console window pops up unlike when Run
is used.
Update: It is better to combine the code above with that of this answer.
I.e let the file $UserBaseDirectory/Autoload/FrontEnd/init.m
contain
FrontEndExecute[FrontEnd`AddMenuCommands["Copy", {MenuItem["Copy Image",
FrontEndExecute[Module[{}, FrontEndExecute[FrontEndToken["Copy"]];
RunProcess[{"C:\\nircmd\\nircmdc.exe", "clipboard", "copyimage",
"\"" <> Export["C:\\nircmd\\asd.png", NotebookGet[ClipboardNotebook[]]] <> "\""}];]],
MenuKey["c", Modifiers -> {"Control", "Command"}],
System`MenuEvaluator -> Automatic, Method -> "Queued"]}]]
which makes Alt Gr+c copy images correctly.
ImageDimensions[im]
is{256, 256}
, but when I evaluateim // CopyToClipboard
and paste in paint, the dimension change to{256, 255}
, a margin of white pixels appears, and artifacts are introduced all over the image pixels. In free clipboard viewer 3.0 for windows, the artifacts appears too. $\endgroup$im // CopyToClipboard
. $\endgroup$