Results 1 to 1 of 1
Thread: Blurring pixels
- 01-01-2008, 02:06 PM #1
Blurring pixels
Hello
In the game that I am developing, I want to draw a relatively small image in a large rectangle. Naturally, the pixels resize into rectangles that are clearly visible. Quality is not important, since it is an background effect for color. I would like to know how to draw the image so that it is blurred when the pixels become larger. This method is similar the the filters used in modern games. I am using BufferedImage objects that are drawn on Graphics objects.
Edit: Solution found
Thanks anyway.Java Code:public void draw(Graphics canvas, Rectangle region){ Graphics2D canvas2D = (Graphics2D) canvas; canvas2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); canvas2D.drawImage(image, (int)region.getX(), (int)region.getY(), (int)region.getWidth(), (int)region.getHeight(), null); }Last edited by tim; 01-02-2008 at 04:52 PM.
Eyes dwelling into the past are blind to what lies in the future. Step carefully.
Similar Threads
-
Modified Pixels
By monkey04 in forum Java 2DReplies: 1Last Post: 03-12-2009, 08:15 AM -
Finding the exact length of a string in a JLabel (in pixels)
By Clarkey in forum Advanced JavaReplies: 2Last Post: 03-25-2008, 05:49 AM -
Counting Pixels
By shaungoater in forum Java 2DReplies: 5Last Post: 11-29-2007, 05:51 PM -
Some form to read pixels in Java and to handle Another plate VGA?
By Albert in forum Advanced JavaReplies: 1Last Post: 06-07-2007, 05:29 AM -
Deleting certain image pixels..
By Brightside in forum New To JavaReplies: 1Last Post: 05-22-2007, 09:21 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks