scale Rectangle - Java 2D Graphics

Java examples for 2D Graphics:Rectangle

Description

scale Rectangle

Demo Code


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

Related Tutorials