Package ch.sahits.game.graphic.image

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


   * @param cropHight divisor for the horizontal cropping
   * @return Rotated and cropped image
   */
  public BufferedImage rotateImage(String imageFile, final double angle,
      final double scale, int cropwidth, int cropHight) {
    BufferedImage srcImg = new ImagesLoader().loadImage(imageFile);

      Graphics2D g = (Graphics2D) srcImg.getGraphics();

      AffineTransform at = new AffineTransform();

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) {
  ImagesLoader 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) {
  ImagesLoader 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

   */
  private synchronized Dimension getImageDimesnion(String fileName){
    if (imgDimensionCache.containsKey(fileName)){
      return imgDimensionCache.get(fileName);
    } else {
      ImagesLoader 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 static BufferedImage createTiledImage(String imageName, int width, int heigth){
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gs = ge.getDefaultScreenDevice();
    GraphicsConfiguration gconf = gs.getDefaultConfiguration();
   
      ImagesLoader 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

      throw new NullPointerException("Client instance may not be null");
    }
    Rectangle rectangle = new Rectangle(rect.x+BORDER_SPACING, rect.y+HORIZONTAL_DECO_HEIGHT, LEFT_STATUS_PANEL_WIDTH, TOP_STATUS_HEIGHT-HORIZONTAL_DECO_HEIGHT);
   
   
    loader = new ImagesLoader("mainScreen.txt");
    background = createBackground();
     
    gameStatus = new GameStatus(rectangle,cl);
    gameStatus.setEnabled(true);   
    rectangle = new Rectangle(rect.x+LEFT_PANEL_WIDTH, rect.y+HORIZONTAL_DECO_HEIGHT, rect.width-(LEFT_PANEL_WIDTH+BORDER_SPACING), TOP_STATUS_HEIGHT-HORIZONTAL_DECO_HEIGHT);
View Full Code Here

        e.printStackTrace();
      }
    }
    // Draw spinner buttons
    int xSpaceing = img.getWidth();
      ImagesLoader loader = new ImagesLoader();
      BufferedImage icon = loader.loadImage("SlabUp.png");
    int h = icon.getHeight();
    g.drawImage( icon, rect.x+xSpaceing,rect.y,null);
    upSpinner = new Rectangle(rect.x+xSpaceing, rect.y, icon.getWidth(), icon.getHeight());
      icon = loader.loadImage("SlabDown.png");
    g.drawImage(icon, rect.x+xSpaceing,rect.y+h,null);
    downSpinner = new Rectangle(rect.x+xSpaceing,rect.y+h, icon.getWidth(), icon.getHeight());
   
  }
View Full Code Here

TOP

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

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.