Java examples for 2D Graphics:Rectangle
scale Rectangle
//package com.java2s; import java.awt.*; public class Main { public static Rectangle scale(Rectangle rect, double scaleFactor) { return new Rectangle(rect.x, rect.y, (int) (rect.getWidth() * scaleFactor), (int) (rect.getHeight() * scaleFactor)); }//w w w . ja v a 2 s. com }