Package ch.sahits.game.graphic.image

Examples of ch.sahits.game.graphic.image.IImageLoader


   */
  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


  public BufferedImage createTiledImage(String imageName, int width, int heigth){
    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 comp that is represented by the slab
* @param paintShadow indicates if the surrounding mortar has a different color
* @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

* @param paintShadow indicates if the surrounding mortar has a different color
* @param fileName file name of the image to be drawn
*/
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

Related Classes of ch.sahits.game.graphic.image.IImageLoader

Copyright © 2018 www.massapicom. 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.