kramann.info
© Guido Kramann

Login: Passwort:










6.2 Bilder bei Processing

6.2 Images at Processing (EN google-translate)

6.2 Obrazy w Processing (PL google-translate)

bildtest2.zip - Beispiel
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.Image;
import java.awt.Image;
import java.net.URI;
import java.net.URL;
import java.io.File;
import javax.swing.ImageIcon;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;


private PImage bild; 

Image bild2;
PImage bild3;

void setup()
{
     Toolkit tk = Toolkit.getDefaultToolkit();
     URL url = this.getClass().getResource("t2.png");
     try
     {
//     URI uri = url.toURI();
//     File file = new File(uri);
     //PImage bild2 = new PImage();     
     size(400,400);
     bild = loadImage("t1.png");
     }
     catch(Exception e)
     {
           println(e);
     }
     
        bild2 = null;
        ImageIcon img = null;        

        try
        {
            bild2 = ImageIO.read(this.getClass().getResourceAsStream("t2.png"));
            //img = new ImageIcon(tk.createImage(bild2.getSource()));
        }
        catch(Exception eee)
        {
            println(eee);
        }        
     
}

void draw()
{
   image(bild,10,10);
}

Code 6.2-1: bildtest2.pde