• Post Reply Bookmark Topic Watch Topic
  • New Topic

Drawing on an Image  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.Using a component's graphics context, you usually draw shapes on the component. How can i draw to an image. Suppose i want to draw a circle.But rather than displaying it on a window, I want it to be drawn as a gif image with a white background, how can i do that? The image does not exist and I want to create it from scratch.
Thank You.
 
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create a java.awt.image.BufferedImage and use the Graphics (Graphics2) object obtained from BufferedImage.getGraphics().
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Swing / AWT / SWT / JFace forum...
[ September 20, 2004: Message edited by: Dirk Schreckmann ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!