Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-01-2008, 03:06 PM
tim's Avatar
tim tim is offline
Senior Member
 
Join Date: Dec 2007
Location: South Africa
Posts: 334
tim is on a distinguished road
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
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.
__________________
If your ship has not come in yet then build a lighthouse.

Last edited by tim : 01-02-2008 at 05:52 PM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding the exact length of a string in a JLabel (in pixels) Clarkey Advanced Java 2 03-25-2008 06:49 AM
Modified Pixels monkey04 Java 2D 0 01-09-2008 08:05 AM
Counting Pixels shaungoater Java 2D 5 11-29-2007 06:51 PM
Some form to read pixels in Java and to handle Another plate VGA? Albert Advanced Java 1 06-07-2007 06:29 AM
Deleting certain image pixels.. Brightside New To Java 1 05-22-2007 10:21 AM


All times are GMT +3. The time now is 09:45 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org