Java Rectangle getSubArea(Shape retangulo, int divisorx, int divisory, int offsetx, int offsety)

Here you can find the source of getSubArea(Shape retangulo, int divisorx, int divisory, int offsetx, int offsety)

Description

get Sub Area

License

Open Source License

Declaration

public static Rectangle getSubArea(Shape retangulo, int divisorx, int divisory, int offsetx, int offsety) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.*;

public class Main {
    public static Rectangle getSubArea(Shape retangulo, int divisorx, int divisory, int offsetx, int offsety) {
        double w = retangulo.getBounds().getWidth() / divisorx;
        double h = retangulo.getBounds().getHeight() / divisory;
        double x = retangulo.getBounds().getX() + (w * offsetx);
        double y = retangulo.getBounds().getY() + (h * offsety);
        Rectangle subRetangulo = new Rectangle((int) x, (int) y, (int) w, (int) h);
        return subRetangulo;
    }/*w w w.j  a  v  a 2  s  .  c o  m*/
}

Related

  1. getFrameOrientations(Rectangle parent)
  2. getMaximalRectangle(Rectangle r1, Rectangle r2)
  3. getRect(byte[] data, int i)
  4. getRectangleProperty(Map p, Object key, Rectangle defaultValue)
  5. getRectLE(byte[] data, int i)
  6. inflateRectangle(Rectangle r, int x, int y)
  7. interpolate(Rectangle r1, Rectangle r2, float f)
  8. mergeRects(Set prev, Set current)
  9. normalizeRect(Rectangle rect)