Package java.awt

Examples of java.awt.Canvas.paint()


  public void gravarImagem() {
    try{
      Canvas c = new Canvas();
      Image img = c.createImage(32, 32);
      Graphics g=img.getGraphics();
      c.paint(g);
      String name = "file.png";
      File f=new File(name);
      f.createNewFile();

      ImageIO.write((RenderedImage) img,"png", f);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.