Archives
Categories
Blogroll
Category Archives: Java
drawImage performance on Leopard
A not very fast but handy way to downscale images in a WebObjects application is using Java 2D APIs, with code like this: BufferedImage reducedImage = new BufferedImage(newX, newY, BufferedImage.TYPE_INT_RGB); Graphics2D g = reducedImage.createGraphics(); g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED); … Continue reading
Posted in Apple, Java, Mac OS X, WebObjects
2 Comments