Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.imageio.ImageIO;
- import java.awt.*;
- import java.awt.image.BufferedImage;
- import java.io.File;
- import java.io.IOException;
- import java.nio.file.Path;
- import java.util.Date;
- public class Printeroo {
- File path = new File("C:\\imaker\\");
- File path2;
- String basename= "";
- String folder= "";
- public Printeroo(){
- System.out.println(path);
- this.basename=basename+".png";
- this.folder= new Date().getTime()+"pic";
- this.path2 = new File("C:\\imaker\\"+folder);
- path2.mkdir();
- }
- public void print(int a) throws IOException {
- int aCopy = a;
- a = Integer.parseInt(Integer.toBinaryString(a));
- System.out.println(a);
- BufferedImage image = ImageIO.read(new File(path, "base.png"));
- BufferedImage p1 = ImageIO.read(new File(path, "1.png"));
- BufferedImage p2 = ImageIO.read(new File(path, "2.png"));
- BufferedImage p3 = ImageIO.read(new File(path, "3.png"));
- BufferedImage p4 = ImageIO.read(new File(path, "4.png"));
- BufferedImage p5 = ImageIO.read(new File(path, "5.png"));
- BufferedImage p6 = ImageIO.read(new File(path, "6.png"));
- BufferedImage p7 = ImageIO.read(new File(path, "7.png"));
- BufferedImage p8 = ImageIO.read(new File(path, "8.png"));
- int w = Math.max(image.getWidth(), image.getWidth());
- int h = Math.max(image.getHeight(), image.getHeight());
- BufferedImage combined = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
- Graphics g = combined.getGraphics();
- g.drawImage(image, 0, 0, null);
- BufferedImage pp ;
- String name = "";
- int tt = a;
- int arco = 1;
- System.out.println(tt);
- while (tt>0){
- int c= tt%10;
- System.out.println("c"+c);
- System.out.println("tt"+tt);
- if(c==1){
- System.out.println(tt+" "+a);
- System.out.println(" I DO"+arco);
- BufferedImage p = ImageIO.read(new File(path, arco+".png"));
- g.drawImage(p,0,0,null);
- name = name + arco;
- }
- arco++;
- tt/=10;
- }
- if(name.equals("")){
- name="0";
- }
- ImageIO.write(combined, "PNG", new File(path2, name+".png"));
- //System.out.println(name);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement