在ASP.NET中使用剪贴板 [英] Use clipboard in ASP.NET

查看:146
本文介绍了在ASP.NET中使用剪贴板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用-Clipboard.GetImage().Save(outimg, outPutImageFormat);

并出现错误:
对象引用未设置为对象的实例.

请帮帮我.

谢谢,

I use - Clipboard.GetImage().Save(outimg, outPutImageFormat);

And have error :
object reference not set to an instance of an object.

Please help me.

Thanks,

推荐答案

发生此错误的原因可能是outimg为null.
试试这个
讨论以使用其他方法保存图像.
This error occurs can be due to outimg be null.
Try this
Discussion to use other methods to save image.


最好的猜测是剪贴板当时不包含图像:
The best guess is that the clipboard does not contain an image at that moment: MSDN DataFormats[^]
if(Clipboard.GetDataObject().GetDataPresent(DataFormats.Bitmap))
   {
   ...
   }


这篇关于在ASP.NET中使用剪贴板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆