首页 技术 正文
技术 2022年11月14日
0 收藏 349 点赞 4,126 浏览 4377 个字

atitit.验证码识别step2——剪贴板ClipBoard copy image图像 attilax总结

剪贴板(ClipBoard)是内存中的一块区域,是Windows内置的一个非常有用的工具,通过小小的剪贴板,架起了一座彩桥,使得在各种应用程序之间,传递和共享信息成为可

系统剪切板一般支持String文本类型和Image图像类型:支持自定义剪切板数据类型

常见的剪切板数据类型

作者:: 老哇的爪子 Attilax 艾龙,  EMAIL:1466519819@qq.com

转载请注明来源: http://blog.csdn.net/attilax

/**

* The <code>DataFlavor</code> representing a Java Unicode String class,

* where:

* <pre>

*     representationClass = java.lang.String

*     mimeType           = "application/x-java-serialized-object"

* </pre>

*/

public static final DataFlavor stringFlavor = createConstant(java.lang.String.class, "Unicode String");

/**

* The <code>DataFlavor</code> representing a Java Image class,

* where:

* <pre>

*     representationClass = java.awt.Image

*     mimeType            = "image/x-java-image"

* </pre>

*/

public static final DataFlavor imageFlavor = createConstant("image/x-java-image; class=java.awt.Image", "Image");

/**

* The <code>DataFlavor</code> representing plain text with Unicode

* encoding, where:

* <pre>

*     representationClass = InputStream

*     mimeType            = "text/plain; charset=unicode"

* </pre>

* This <code>DataFlavor</code> has been <b>deprecated</b> because

* (1) Its representation is an InputStream, an 8-bit based representation,

* while Unicode is a 16-bit character set; and (2) The charset "unicode"

* is not well-defined. "unicode" implies a particular platform’s

* implementation of Unicode, not a cross-platform implementation.

*

* @deprecated as of 1.3. Use <code>DataFlavor.getReaderForText(Transferable)</code>

*             instead of <code>Transferable.getTransferData(DataFlavor.plainTextFlavor)</code>.

*/

@Deprecated

public static final DataFlavor plainTextFlavor = createConstant("text/plain; charset=unicode; class=java.io.InputStream", "Plain Text");

/**

* A MIME Content-Type of application/x-java-serialized-object represents

* a graph of Java object(s) that have been made persistent.

*

* The representation class associated with this <code>DataFlavor</code>

* identifies the Java type of an object returned as a reference

* from an invocation <code>java.awt.datatransfer.getTransferData</code>.

*/

public static final String javaSerializedObjectMimeType = "application/x-java-serialized-object";

/**

* To transfer a list of files to/from Java (and the underlying

* platform) a <code>DataFlavor</code> of this type/subtype and

* representation class of <code>java.util.List</code> is used.

* Each element of the list is required/guaranteed to be of type

* <code>java.io.File</code>.

*/

public static final DataFlavor javaFileListFlavor = createConstant("application/x-java-file-list;class=java.util.List", null);

/**

* To transfer a reference to an arbitrary Java object reference that

* has no associated MIME Content-type, across a <code>Transferable</code>

* interface WITHIN THE SAME JVM, a <code>DataFlavor</code>

* with this type/subtype is used, with a <code>representationClass</code>

* equal to the type of the class/interface being passed across the

* <code>Transferable</code>.

* <p>

* The object reference returned from

* <code>Transferable.getTransferData</code> for a <code>DataFlavor</code>

* with this MIME Content-Type is required to be

* an instance of the representation Class of the <code>DataFlavor</code>.

*/

public static final String javaJVMLocalObjectMimeType = "application/x-java-jvm-local-objectref";

/**

* In order to pass a live link to a Remote object via a Drag and Drop

* <code>ACTION_LINK</code> operation a Mime Content Type of

* application/x-java-remote-object should be used,

* where the representation class of the <code>DataFlavor</code>

* represents the type of the <code>Remote</code> interface to be

* transferred.

*/

public static final String javaRemoteObjectMimeType = "application/x-java-remote-object";

/**

prj.atibrow

//获取粘贴板图片

Image image = null;

try {

image = ClipboardUtil.getImageFromClipboard();

} catch (Exception e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

/**

* 从剪切板获得图片。

*/

public static Image getImageFromClipboard() throws Exception {

Clipboard sysc = Toolkit.getDefaultToolkit().getSystemClipboard();

Transferable cc = sysc.getContents(null);

if (cc == null)

return null;

else if (cc.isDataFlavorSupported(DataFlavor.imageFlavor))

return (Image) cc.getTransferData(DataFlavor.imageFlavor);

return null;

}

java操作系统剪切板Clipboard及自定义剪切板 – – ITeye技术网站.htm

关于java.awt.datatransfer.Clipboard的复制图片等等_小组_ThinkSAAS.htm

java读取粘贴板内容——将图片转成png或者jpg格式 – – 博客频道 – CSDN.NET.htm

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,488
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,903
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,737
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,489
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,128
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,290