Search |
||
The image resizing challengePosted by robogeek on May 22, 2007 at 4:00 PM PDT
There's this challenge which was posted, well really it's a long complaint about complexity. Fabrizio Giudici posted an alternative using the Mistral toolkit. It's interesting he says it takes a hundred lines of code to resize an image, when I (with my meager experience in graphics code) was able to do it in 5 lines of code over three years ago.
Then to read & write the image you'd use javax.image.ImageIO, there are convenience functions so reading and writing is one line of code. But it's only one line of code if you're okay with the defaults. UPDATE: I shoulda read the article he referenced. Chris Campbell was discussing the problems with using getScaledInstance (the method I used above) and offering alternative approaches that are more modern. Chris offers this idiom as a simple/fast way to scale an image:
Which leads to the following code (untested) which should do the job
six lines. »
Comments
Comments are listed in date ascending order (oldest first)
|
||
|
|