public BufferedImage loadBuffer(String fullPath, String textureName, boolean flipVertical) { File file = new File(fullPath+textureName); try { //return TextureIO.newTexture(file, false); BufferedImage image = ImageIO.read(file); if(image != null && flipVertical) { ImageUtil.flipImageVertically(image); } return image; } catch (GLException e) { System.err.println("Error creating texture from: "+file); e.printStackTrace(); } catch (IOException e) { System.err.println("File not found: "+file); e.printStackTrace(); } return null; }
final BufferedImage temp = createCompatibleImage(width, (int) (width / ratio)); final Graphics2D g2 = temp.createGraphics(); g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
private void storeZoom(boolean withName, String name) { Rectangle2D zoomstore = this.quadTreeRectToRectangle2D(this.viewBounds); if(withName) { final JDialog d = new JDialog((JFrame)null,"Name for this zoom", true); JTextField field = new JTextField(20); ActionListener al = new ActionListener() { @Override public void actionPerformed( ActionEvent e ) { d.setVisible(false); } }; field.addActionListener(al); d.getContentPane().add(field); d.pack(); d.setVisible(true); name = field.getText(); } this.canvas.repaint(); BufferedImage image = ImageUtil.createThumbnail(this.current, 300); otfVisConfig.addZoom(new ZoomEntry(image,zoomstore, name)); }
ImageUtil.flipImageVertically(image);
ZoomEntry z = zooms.get(i); JButton b = buttons.get(i); ImageIcon icon = new ImageIcon(ImageUtil.createThumbnail(z.getSnap(),Math.min(z.getSnap().getWidth(),b.getSize().width)-20)); b.setIcon(icon);
final BufferedImage image = getAWTGLPixelBuffer().getAlignedImage(width, height); if( getTextureData().getMustFlipVertically() ) { ImageUtil.flipImageVertically(image);