开发者

Clipboard.SetImage doesn't work when pasting in to Windows Live Writer

开发者 https://www.devze.com 2023-03-15 03:09 出处:网络
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开发者_StackOver

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开发者_StackOverflow中文版 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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号