bufferedimage

Clipboard copy from outlook always has black background set when retrieved as image from Java clipboard object

假如想象 提交于 2020-01-21 10:06:28
问题 Here are the application steps copy some richtext from a html email message or from a website(a combination of text + image) In your java code retrieve the content copied from the clipboard object as BufferredImage Save the retrieved image object as image file on disk 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

Clipboard copy from outlook always has black background set when retrieved as image from Java clipboard object

只谈情不闲聊 提交于 2020-01-21 10:05:13
问题 Here are the application steps copy some richtext from a html email message or from a website(a combination of text + image) In your java code retrieve the content copied from the clipboard object as BufferredImage Save the retrieved image object as image file on disk 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

Impact of TYPE_INT_ARGB_PRE

丶灬走出姿态 提交于 2020-01-17 09:11:08
问题 I've been having some issues with a ConvolveOp that can be fixed by setting the imageType of the BufferedImage I'm working with to TYPE_INT_ARGB_PRE (see related SO answer here). Unfortunately I don't fully understand all the implications of selecting this different imageType and I can't seem to find a good reference either, so let me try here: Which drawing operations are affected by changing the imageType of a BufferedImage from TYPE_INT_ARGB to TYPE_INT_ARGB_PRE? Is it just

Drawing an image on top of an image in a JComponent erases part of the bottom image

狂风中的少年 提交于 2020-01-17 05:38:41
问题 I am making a 2d game and I need to draw an image on top of another. After I draw the first image(the larger one, jpg), the second image(the smaller one,png) erases from where the second image is to the lower right hand corner. Like this: I have looked into this a bit, and it was suggested that I use buffered images, so I did that with both images and the problem remains. Here is one post I looked at: How to draw an image over another image?. I have also seen some people suggesting graphics2d

Java transforming BufferedImage “Subimage” defined by 4 Points [duplicate]

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-17 05:08:55
问题 This question already has an answer here : How to get sub image from buffered image (1 answer) Closed 3 years ago . I've been doing some work on my school project and came to the point where i need help again :) I've been researching about transforming images in Java, but i haven't really found any useful information in terms of that. I have found this article but since I don't know much python i wasn't able to get what they are doing. I'd like to do pretty much the same thing, but in Java.

Java Image Connective Component

ε祈祈猫儿з 提交于 2020-01-16 05:10:48
问题 I have this program to detect objects in a binarized BufferedImage, which the image is a multiple choice answer sheet. I'm trying to use 4-Connectivity as in to detect each object (answer on the sheet). So far what I have in hand as source is these: http://en.wikipedia.org/wiki/Connected-component_labeling http://homepages.inf.ed.ac.uk/rbf/HIPR2/label.htm and I have came up with this, following instructions from Wikipedia: if(getPixel(image, x, y) != 0){ if(getPixel(image, x-1, y) !=0){

How to change the image type of a BufferedImage which is loaded from file?

谁说我不能喝 提交于 2020-01-15 06:21:07
问题 I'm trying to access the pixels in a BufferedImage which is loaded from a file using ImageIO.read(filePath) , but I get this error : Exception in thread "Game" java.lang.ClassCastException: java.awt.image.DataBufferByte cannot be cast to java.awt.image.DataBufferInt at com.package.graphics.Texture.<init>(Texture.java:29) at com.package.graphics.Texture.loadTexture(Texture.java:40) at com.package.Game.run(Game.java:71) at java.lang.Thread.run(Unknown Source) In the code, the line which the

How to bend an Image in java

会有一股神秘感。 提交于 2020-01-13 06:00:29
问题 Is there any way to bend a BufferedImage in Java? I thought that if I crop the image into smaller pieces and rotate them then I would essentially bend the image, but it doesn't seem to work. Here is the method I created: /** * This is a recursive method that will accept an image the point where the bending will start and the point where the bending will end, as well as the angle of bending * * @param original:the original image * @param startingPoint: the point where the bending should start

Java Swing BufferedImage poor quality

六眼飞鱼酱① 提交于 2020-01-13 05:06:08
问题 I'm trying to create a drawing on BufferedImage and then copy in onto JPanel. When I draw directly on JPanel quality of the picture is v.good but when using intermediate BufferedImage quality / resolution is visibly reduced. I've checked that with zoom option from OSX's Accessibility panel. I'm developing on MacBook Pro Retina. Is there some sort of automated scaling happening? What am I doing wrong with BufferedImage? Here's the code demonstrating the problem package com.sample.gui; import

Get average color on bufferedimage and bufferedimage portion as fast as possible

荒凉一梦 提交于 2020-01-12 10:07:25
问题 I am trying to find image in an image. I do this for desktop automation. At this moment, I'm trying to be fast, not precise. As such, I have decided to match similar image solely based on the same average color. If I pick several icons on my desktop, for example: And I will search for the last one (I'm still wondering what this file is): You can clearly see what is most likely to be the match: In different situations, this may not work. However when image size is given, it should be pretty