Guest User

Untitled

a guest
Jun 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import java.io.File;
  2. import picClass.FileMgr;
  3. import picClass.Picture;
  4. public class PictureTest
  5. {
  6. public static void main(String[] args)
  7. {
  8. System.out.println("select a folder containing element images");
  9. String path = FileMgr.selectDirectoryName();
  10. File directory = new File(path);
  11. File[] files = directory.listFiles();
  12. Picture[] pics = new Picture[files.length];
  13. int i = 0;
  14. for (File f : files)
  15. {
  16. if (f.getPath().endsWith("png") || f.getPath().endsWith("gif") || f.getPath().endsWith("jpg"))
  17. {
  18. pics[i] = new Picture(f.getPath());
  19. i++;
  20. }
  21. }
  22. System.out.println("select a main image to be mosaiced");
  23. Picture main1 = new Picture(FileMgr.selectExistingFilename());
  24. Picture mosaic1 = WTPhotoOtto.mosaic(main1, pics, 100);
  25. }
  26. }
Add Comment
Please, Sign In to add comment