init lserp cs 5.0
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.PubUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// 剪切板公共方法
|
||||
/// </summary>
|
||||
public static class ClipboardHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 查找剪切板图片
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static Image FindClipboardImage()
|
||||
{
|
||||
try
|
||||
{
|
||||
IDataObject data = Clipboard.GetDataObject();
|
||||
if (data.GetDataPresent(typeof(Bitmap)))
|
||||
{
|
||||
return (Image)data.GetData(typeof(Bitmap));
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/// <summary>
|
||||
/// 剪切板是否包含图片
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool ContainsImage()
|
||||
{
|
||||
try
|
||||
{
|
||||
return Clipboard.ContainsImage();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user