粘贴到 Windows Live Writer 时 Clipboard.SetImage 不起作用
我正在使用 Clipboard.SetImage 复制图像,我可以将此图像粘贴到 mspaint 中,它工作正常。但是,如果我尝试将图像粘贴到 WLW 中,它只会粘贴一个空行。如果我从 Web 浏览器复制图像,然后将其粘贴到 WLW,那么它会按预期工作。该图像来自 ImageList。我尝试过简单地调用 Clipboard.SetImage,并且还尝试将图像绘制到位图上并复制:
Bitmap bmp = new Bitmap(img.Width, img.Height);
Graphics gfx = Graphics.FromImage(bmp);
gfx.Clear(Color.White);
gfx.DrawImageUnscaled(img, new Point(0, 0));
gfx.Dispose();
Clipboard.SetImage(bmp);
任何帮助都会很棒,
谢谢,
乔
I'm using Clipboard.SetImage to copy an image, I can paste this image in to mspaint and it works fine. However if I try to paste the image in to WLW it just pastes an empty line. If I copy an image from my web browser and then paste that in to WLW then it works as expected. The image is from an ImageList. I've tried simply calling Clipboard.SetImage and I've also tried drawing the image on to a Bitmap and copying that:
Bitmap bmp = new Bitmap(img.Width, img.Height);
Graphics gfx = Graphics.FromImage(bmp);
gfx.Clear(Color.White);
gfx.DrawImageUnscaled(img, new Point(0, 0));
gfx.Dispose();
Clipboard.SetImage(bmp);
Any help would be great,
Thanks,
Joe
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论