e587. Filling Basic Shapes

Posted borter

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了e587. Filling Basic Shapes相关的知识,希望对你有一定的参考价值。

There are two ways to fill basic shapes like lines and rectangles. The first is to use specific drawing methods like Graphics.fillOval(). This example uses these methods. The second is to construct a shape and then use Graphics2D.fill() to fill the shape. See the java.awt.geom package for examples that create shapes.

    
g2d.fillArc(x, y, w, h, startAngle, arcAngle);
    g2d.fillOval(x, y, w, h);
    g2d.fillRect(x, y, w, h);
    g2d.fillRoundRect(x, y, w, h, arcWidth, arcHeight);
    
    Polygon polygon = new Polygon();
    polygon.addPoint(x, y);
    // ...continue adding points
    g2d.fillPolygon(polygon);

 

Related Examples

以上是关于e587. Filling Basic Shapes的主要内容,如果未能解决你的问题,请参考以下文章

Codeforces Round #589 (Div. 2)-E. Another Filling the Grid-容斥定理

Another Filling the Grid

CodeForces 587 E.Duff as a Queen 线段树动态维护区间线性基

*Codeforces587E. Duff as a Queen

shape into blocks--source code in python based on pySpark

e658. 组合图形