View Single Post
  #1 (permalink)  
Old 07-17-2007, 05:21 AM
samson samson is offline
Member
 
Join Date: Mar 2007
Posts: 16
samson is on a distinguished road
Why this image background is black ?
Code:
public void drawShape(int w, int h){ Graphics2D graphics2D ; BufferedImage bufferedImage = new BufferedImage( 45, 56, BufferedImage.TYPE_INT_ARGB ); File imgFile = new File("C:\\test.jpg"); graphics2D = bufferedImage .createGraphics(); graphics2D .setBackground(Color.WHITE); graphics2D .setColor( Color.WHITE ); try { ImageIO.write( bufferedImage , "jpg", imgFile ); } catch ( IOException e ) { e.printStackTrace(); } }
Reply With Quote
Sponsored Links