<p dir="auto">I do not have an answer, so I post it again. I will delete it if there is a problem.<br>
I use React and Elextron together.</p>
<p dir="auto">Output of node_modules/.bin/electron --version:<br>
[ I have verified the package.json file. ]<br>
"electron": "2.0.2",<br>
"electron-builder": "19.31.1",<br>
"electron-prebuilt": "^1.4.13",<br>
"electron-rebuild": "^1.5.11",</p>
<p dir="auto">Operating System (Platform and Version): [ window10 ]</p>
<p dir="auto">Expected behavior<br>
[ jpeg type images must be saved to the clipboard.]</p>
<p dir="auto">Actual behavior<br>
[ An image of type png is saved to the clipboard. ]</p>
<p dir="auto">The store can not be attached due to security reasons. Attach react source code instead.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="copyClipboard(){
        let that = this;
        var xhr = new XMLHttpRequest();
        xhr.onload = function() {
            var reader = new FileReader();
            reader.onloadend = function() {    
     
                let image = nativeImage.createFromDataURL(reader.result);
                clipboard.writeImage(image, 'jpeg');

            }
            reader.readAsDataURL(xhr.response);
        };
        xhr.open('GET', imgURL);
        xhr.responseType = 'blob';
        xhr.send();
}"><pre class="notranslate"><code class="notranslate">copyClipboard(){
        let that = this;
        var xhr = new XMLHttpRequest();
        xhr.onload = function() {
            var reader = new FileReader();
            reader.onloadend = function() {    
     
                let image = nativeImage.createFromDataURL(reader.result);
                clipboard.writeImage(image, 'jpeg');

            }
            reader.readAsDataURL(xhr.response);
        };
        xhr.open('GET', imgURL);
        xhr.responseType = 'blob';
        xhr.send();
}
</code></pre></div>
<ul dir="auto">
<li>Output of <code class="notranslate">node_modules/.bin/electron --version</code>:2.0.8</li>
<li>Operating System (Platform and Version):MacOS</li>
</ul>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/10068397/45607960-78ccc280-ba82-11e8-950d-1945bebddac8.png"><img src="https://user-images.githubusercontent.com/10068397/45607960-78ccc280-ba82-11e8-950d-1945bebddac8.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/10068397/45607833-94839900-ba81-11e8-813b-544f5c4958e3.png"><img src="https://user-images.githubusercontent.com/10068397/45607833-94839900-ba81-11e8-813b-544f5c4958e3.png" alt="image" style="max-width: 100%;"></a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ipcMain.on(&quot;copy&quot;,(event, arg) =&gt;{
  const imagePath = &quot;1.png&quot;
  const image = nativeImage.createFromPath(imagePath)
  const { width, height } = image.getSize()
  clipboard.writeImage(nativeImage.createFromBuffer(image.toPNG()),'png')
  console.log(&quot;复制成功&quot;,width,height,clipboard.availableFormats())
})"><pre class="notranslate"><code class="notranslate">ipcMain.on("copy",(event, arg) =&gt;{
  const imagePath = "1.png"
  const image = nativeImage.createFromPath(imagePath)
  const { width, height } = image.getSize()
  clipboard.writeImage(nativeImage.createFromBuffer(image.toPNG()),'png')
  console.log("复制成功",width,height,clipboard.availableFormats())
})
</code></pre></div>