View Single Post
  #3 (permalink)  
Old 01-24-2008, 07:52 AM
CaptainMorgan's Avatar
CaptainMorgan CaptainMorgan is offline
Moderator
 
Join Date: Dec 2007
Location: NewEngland, US
Posts: 841
CaptainMorgan will become famous soon enoughCaptainMorgan will become famous soon enough
Send a message via AIM to CaptainMorgan
What's your code look like? Here's what I did:
Code:
public class Test { public static void textToImage4() throws IOException { int width = 200, height = 135; BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); Graphics g = image.getGraphics(); g.setColor(Color.pink); g.fillRect(0, 0, width, height); // Font font = new Font("SERIF", Font.BOLD, 18); // g2.setFont(font); g.setColor(Color.black); g.drawString("test", 46 , 54); g.dispose(); ImageIO.write(image, "jpg", new File("test.jpg")); } public static void main(String[] args) { Test t = new Test(); try { t.textToImage4(); } catch (IOException ioE) { ioE.printStackTrace(); } } }
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
to our beloved Java Forums!
(closes on September 4, 2008)
Want to voice your opinion on your IDE/Editor of choice?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
!
Got a little Capt'n in you? (drink responsibly)
Reply With Quote