Package ch.sahits.game.graphic.image

Examples of ch.sahits.game.graphic.image.IImageLoader.loadImage()


  private synchronized Dimension getImageDimesnion(String fileName){
    if (imgDimensionCache.containsKey(fileName)){
      return imgDimensionCache.get(fileName);
    } else {
      IImageLoader loader = new ImagesLoader();
      BufferedImage baseImg = loader.loadImage(fileName);
      Dimension dim = new Dimension(baseImg.getWidth(), baseImg.getHeight());
      imgDimensionCache.put(fileName, dim);
      return dim;
    }
  }
View Full Code Here


    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gs = ge.getDefaultScreenDevice();
    GraphicsConfiguration gconf = gs.getDefaultConfiguration();
   
      IImageLoader loader = new ImagesLoader();
      BufferedImage baseImg = loader.loadImage(imageName);
      final int xSize = baseImg.getWidth();
      final int ySize = baseImg.getHeight();
      int vCount = width/xSize;
      if (width%xSize>0){
        vCount++;
View Full Code Here

* @param fileName file name of the image to be drawn
*/
private void drawSlab(Graphics graphics, Rectangle bounds, String fileName, int reduce) {
  IImageLoader loader = new ImagesLoader();
   
    BufferedImage img = loader.loadImage(fileName);
    final int posX=bounds.x;
    final int posY=bounds.y;
    final int destWidth= (int)Math.rint(bounds.getWidth())-reduce;
    final int destHight=(int)Math.rint(bounds.getHeight());

View Full Code Here

*/
private BufferedImage createSlab(Graphics graphics, String text,
    String fileName, int reduce, Rectangle bounds) {
  IImageLoader loader = new ImagesLoader();
   
    BufferedImage img = loader.loadImage(fileName);
    final int destWidth= (int)Math.rint(bounds.getWidth())-reduce;
    final int destHight=(int)Math.rint(bounds.getHeight());

    float xScale = (float) destWidth / img.getWidth();
    float yScale = (float) destHight / img.getHeight();
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.