Questions tagged [bufferedimage]

The Java class BufferedImage is used to read and manipulate images and assist in double-buffering in desktop GUI applications.

The java.awt.image.BufferedImage Java class is part of the Abstract Windowing Toolkit group of classes that form part of the standard JDK.

The BufferedImage class contains methods to manipulate pixel values and is also used for double-buffering in applications that have a Java Swing GUI.

2150 questions
0
votes
1 answer

Socket recieves Images with delay of 1

I have a socket that recieves images via one InputStream that doesnt get closed. I want to send images continiously that way. But now the images get recieved with a delay of 1 image (the first one after I sent the second one, the second one after I…
user2444765
0
votes
1 answer

Stacking rotated images into one combined image

I am writing a Poker game and am currently trying to write a class that produces an image of a given hand. I initially just produced an image by combining the images of each of the 5 cards alongside each other. This was the result: I then decided…
KOB
  • 4,084
  • 9
  • 44
  • 88
0
votes
0 answers

Cannot render video from BufferedImage using HashMap in Java

In my project, I have got a class FramesUtil which contains a set of frames stored in a HashMap - ConcurrentHashMap frameMap I have another class Arbiter.java that should render video using frames from frameMap. However, I can…
0
votes
0 answers

Unexpected color mapping when using IndexColorModel

I have some old Java 6 code to convert a black, white, and transparent image to a new color palette with two opaque colors and a transparent color. int[] cmap = { 0x000000, 0x6c4eee, 0x2e00a4 }; IndexColorModel icm = new IndexColorModel(2,…
augurar
  • 12,081
  • 6
  • 50
  • 65
0
votes
1 answer

Messy diagram derives when it comes to printing it on pdf by using MS Windows 10 service

I've been writing Java SE 8 desktop application. I use Eclipse IDE, Oracle's JDK, and run it on MS Windows 10 OS. My app draws diagrams, in short. I draw a diagram on JPanel which becomes part of JTabbedPane. It displays it well on GUI, and it is…
ucas
  • 417
  • 1
  • 11
  • 30
0
votes
1 answer

Problem converting bytes from a Bing Map request into a BufferedImage

I have very little experience with Java IO and images, and I've been unsuccessful at converting an aerial image saved as a byte array into a BufferedImage. Here's my code: int width = scaledImage.getWidth(); int height =…
Ceniza
  • 120
  • 2
  • 11
0
votes
1 answer

Java HTTP Post Applet server - Internally generated Image

I have a BufferedImage created using J2D in an applet. I want to upload this BufferedImage using HTTP Post @ http://localhost:3001/upload/file. EDIT: I have a ROR server handling the serverside of things, I am looking for the Java code for the…
slotishtype
  • 2,715
  • 7
  • 32
  • 47
0
votes
2 answers

Setting the pixel color of BufferedImage using byte array

I have converted an image to an array using the following code: BufferedImage bufferedImage = null; try { bufferedImage = ImageIO.read(new File("name.jpeg")); } catch (IOException e) { } byte[] b = ((DataBufferByte)…
orglce
  • 513
  • 2
  • 7
  • 19
0
votes
1 answer

JAVA: Why images is loaded slower than the app, Window Frame?

I'm using an image to draw a background for a Java app, a big one without repeat property. To do so, I used bufferedImage to read the resource, the image, and draw it in a Canvas. Well, it works almost fine. Except one thing, the app still opens…
Star Light
  • 154
  • 2
  • 8
  • 19
0
votes
0 answers

Java: Export new Graphics object based off another Graphics object as PNG

I a stuck on trying to export an image of a graphics object. This is what the method looks like: private BufferedImage paintImage; public void paint(Graphics g){ super.paint(g); paintImage = new BufferedImage(500, 600,…
gkdub
  • 1
  • 2
0
votes
0 answers

BufferedImage only Appears when Window is Minimized and Re-Maximized

I'm currently writing an application using Java Swing. So far, the application is simple, it creates a window (JFrame) that fills the screen. This JFrame has a main JPanel, and in that JPanel is a JLabel for the title and a JLabel that I'm loading a…
Thomas
  • 1,123
  • 3
  • 13
  • 36
0
votes
1 answer

How do I find the pixel color of a given point inside a JPanel with a moving image?

How do I find the pixel color of a given point inside a JPanel with a moving image? Can I do this using BufferedImage or Graphics?
0
votes
0 answers

Reading ICNS files to BufferedImage[] object

I have an ICNS file with multiple icons in it. I need to convert it to an array of BufferedImage objects using Java code. I did this using commons-imaging library by apache. It turns out I cannot use that library within my organization. Is there any…
0
votes
0 answers

ImageBuffer not printing in JPanel

I have a drawShapeAt method in a class that should print a shape at a given location @Override public void drawShapeAt(int x, int y) { try { canvas.removeMouseListener(ml); } catch (Exception e) { } …
Alexandru Antochi
  • 1,295
  • 3
  • 18
  • 42
0
votes
1 answer

Is there a way of copying a JPanel's Graphic2D instance to make a Graphic2D for a BufferedImage?

I have a JPanel which displays a graph using the Graphic2D. This works fine. I now want to be able to save the graph to a file. So far the only way I can get this to work is create a BufferedImage and everything I write to the JPanels Graphic2D…
Tony Wolff
  • 732
  • 1
  • 10
  • 23