@@ -0,0 +1,1908 @@
+/*%0A *               In the name of Allah%0A * This file is part of The %22Quran Teacher or Learn Arabic%22 Project. Use is subject to%0A * license terms.%0A *%0A * @author:         Fazle Rabbi Rahat%0A * %0A */%0Apackage QuranTeacher.RenderImages;%0A%0Aimport java.awt.Image;%0Aimport java.awt.image.BufferedImage;%0Aimport java.io.File;%0Aimport java.io.IOException;%0A%0Aimport javax.imageio.ImageIO;%0A%0Apublic class ImageLoader %0A%7B%0A%09/*%0A%09 * Loads images from file%0A%09 */%0A%09//public static List%3CImage%3Eimages=new ArrayList%3C%3E();%0A%09public static String ImageFileType=%22.img%22;%0A%09%0A%09private static String defaultDir=System.getProperty(%22user.dir%22)+%22/WbWImages%22;%0A%09//private final int lastImageId=77429;%0A%09public ImageLoader() %0A%09%7B%0A%09%09File directory=new File(defaultDir);%0A%09%09if(!directory.exists())%0A%09%09%7B%0A%09%09%09directory.mkdir();%0A%09%09%7D%0A%09%7D%0A%09%0A%09//this wasn't called%0A/*%09public void load()%0A%09%7B%0A%09%09BufferedImage img = null;%0A%09%09File imageFile=null;%0A%09%09%0A%09%09for(int i=1;i%3C=lastImageId;i++)%0A%09%09%7B%0A%09%09%09imageFile=new File(defaultDir+%22/%22+Integer.toString(i)+ImageFileType);%0A%09%09%09%0A%09%09%09if(imageFile.exists())%0A%09%09%09%7B%0A%09%09%09%09try%0A%09%09%09%09%7B%0A%09%09%09%09%09img = ImageIO.read(imageFile);%0A%09%09%09%09%09images.add(img);%0A%09%09%09%09%7D%0A%09%09%09%09catch(IOException io)%0A%09%09%09%09%7B%0A%09%09%09%09%09//io.printStackTrace();%0A%09%09%09%09%09System.out.println(imageFile.getName()+%22 loading failed%22);%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09else%0A%09%09%09%09break;%0A%09%09%7D%0A%09%09%0A%09%09System.out.println(%22Images loaded :%22+images.size());%0A%09%7D%0A%09%0A%09public static Image getImage(int imageId)%0A%09%7B%0A%09%09if(images.size()%3E=imageId)%0A%09%09%09return images.get(imageId-1);%0A%09%09return null;%0A%09%7D*/%0A%09%0A%09public static Image getImageFromFile(int imageIndex)%0A%09%7B%0A%09%09BufferedImage img = null;%0A%09%09File imageFile=null;%0A%09%09%0A%09%09imageFile=new File(defaultDir+%22/%22+Integer.toString(imageIndex+1)+ImageFileType);%0A%09%09%0A%09%09if(imageFile.exists())%0A%09%09%7B%0A%09%09%09try%0A%09%09%09%7B%0A%09%09%09%09img = ImageIO.read(imageFile);%0A%09%09%09%09//images.add(img);%0A%09%09%09%7D%0A%09%09%09catch(IOException io)%0A%09%09%09%7B%0A%09%09%09%09//io.printStackTrace();%0A%09%09%09%09System.out.println(imageFile.getName()+%22 loading failed%22);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return img;%0A%09%7D%0A%7D%0A

Create ImageLoader.java