About 180,000 results
Open links in new tab
  1. How Can I Resize an Image Using Java? - Baeldung

    Mar 26, 2025 · Core Java offers the following options for resizing images: Graphics2D is the fundamental class for rendering 2-dimensional shapes, text, and images on the Java platform. …

  2. java - How do you use re-size all Graphic2D - Stack Overflow

    Dec 12, 2014 · For this you can use the Graphics2D.scale(double,double), Graphics2D.rotate(double), Graphics2D.translate(double,double) and …

  3. Java Graphics2D Translate and Scale - Stack Overflow

    Jun 11, 2015 · Here's the code I have so far to do it: AffineTransform t = new AffineTransform(); float a = 400 - player.getX(); float b = 250 - player.getY(); t.translate(a, b); /* * Here's where I …

  4. Scale images as a single surface in Java 2D API

    Sep 27, 2014 · Try the SCALE_AREA_AVERAGING and the SCALE_SMOOTH for nicer scaled images. // Scaled 3 times: Image img2 = img.getScaledInstance(img.getWidth(null)*3, …

  5. Transforming Shapes, Text, and Images (The Java™ Tutorials > 2D ...

    You can modify the transform attribute in the Graphics2D context to move, rotate, scale, and shear graphics primitives when they are rendered. The transform attribute is defined by an …

  6. How to Properly Scale a BufferedImage in Java - CodingTechRoom

    Scaling a BufferedImage in Java requires a method to preserve the quality and content of the image. The Graphics2D class provides ways to draw and manipulate images but simply …

  7. How to resize images in Java - CodeJava.net

    Aug 14, 2019 · In Java, to resize (or scale) an image read from an image file and save the scaled image into another image file, we can follow these steps: Create a BufferedImage object for …

  8. Scale image in Java and preserve its quality

    Jun 8, 2020 · From the core Java features, there are two main ways to scale image - using Graphics2D and Image.getScaledInstance(). They provide us with certain configuration …

  9. Best Java Resize Image: How To Resize Image In Java 2025

    Feb 13, 2025 · Java Resize Image Without Losing Quality. A reliable method uses Java’s Graphics2D API with carefully chosen rendering hints. This approach preserves detail when …

  10. How to resize the buffered image n graphics 2d in java?

    Jan 21, 2011 · int width = 175; Graphics2D gb = (Graphics2D) g; bufferedimage = (BufferedImage) createImage(width, width); Graphics2D graphics = …

Refresh