[英]Clipboard copy from outlook always has black background set when retrieved as image from Java clipboard object
Here are the application steps 这是申请步骤
You'll notice that in the saved file, the image comes fine, any non-black text appears fine but black text seems lost in the black background. 您会注意到,在已保存的文件中,图像可以正常显示,所有非黑色文本都可以正常显示,但黑色文本似乎在黑色背景中丢失了。 Could not find a way to override the black background for the generated image. 无法找到一种方法来覆盖生成的图像的黑色背景。 Some example code below. 下面是一些示例代码。
BufferedImage image = null;
try {
image = (BufferedImage) transferable.getTransferData(DataFlavor.imageFlavor);
} catch (UnsupportedFlavorException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
saveImageToDisk(image);
private void saveImageToDisk(BufferedImage image) {
File outputFile = new File("c:\\image.png");
try {
ImageIO.write(image, "png", outputFile);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Found the solution - it is to use a custom system flavour which understands the mimetype of 'image\\x-emf'. 找到了解决方案-它是使用一种了解'image \\ x-emf'模仿类型的自定义系统风格。 strip first 8 bytes and write the remaining content as Bufferred image 剥离前8个字节并将剩余内容写为Bufferred映像
Found the solution - it is to use a custom system flavour which understands the mimetype of 'image\\x-emf'. 找到了解决方案-它是使用一种了解'image \\ x-emf'模仿类型的自定义系统风格。 strip first 8 bytes and write the remaining content as Bufferred image 剥离前8个字节并将剩余内容写为Bufferred映像
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.