I have a project to carry out, my company does the design of advertising panels (design and printing). when calculating pricing (area * material price) we find several difficulties because of inaccurate area that we calculate manually because of the irregular shape of the design (it contains several curvature). So we thought of making an application that can calculate the price and the exact area of a shape. I have several ideas but I walk slowly starting with the java language .... I uploaded an image from my desktop, this image has an irregular shape with bends. i draw it by adobe illustrator and convert it to jpeg .. my question is: how do i calculate the area of this shape. I started to load it with java and draw it with this code
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class ImagePanel extends JPanel {
/**
*
*/
private static final long serialVersionUID = 1L;
public BufferedImage image;
public ImagePanel()
{
try {
image = ImageIO.read(new File("C:/Users/pc/Desktop/Inés/image.jpg"));
} catch (IOException ex) {
// handle exception...
System.out.println(ex.getMessage());
}
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.drawImage(image, 0, 0, this); // see javadoc for more info on the parameters
}
}
and then do some calculations but I'm stuck. If you have any solution please help me. If I use other language or software already exist thank you.