Results 1 to 1 of 1

Thread: Blurring pixels

  1. #1
    tim's Avatar
    tim is offline Senior Member
    Join Date
    Dec 2007
    Rep Power

    Talking Blurring pixels


    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
    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);
    Thanks anyway.
    Last edited by tim; 01-02-2008 at 05:52 PM.
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

Similar Threads

  1. Modified Pixels
    By monkey04 in forum Java 2D
    Replies: 1
    Last Post: 03-12-2009, 09:15 AM
  2. Replies: 2
    Last Post: 03-25-2008, 06:49 AM
  3. Counting Pixels
    By shaungoater in forum Java 2D
    Replies: 5
    Last Post: 11-29-2007, 06:51 PM
  4. Replies: 1
    Last Post: 06-07-2007, 06:29 AM
  5. Deleting certain image pixels..
    By Brightside in forum New To Java
    Replies: 1
    Last Post: 05-22-2007, 10:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts