FlatChart.java 文件源码

java
阅读 40 收藏 0 点赞 0 评论 0

项目:SmartMath 作者:
/**
 * Draws the chart background.
 */
public void drawBackground(Canvas canvas, double x, double y, double width, double height,
                            Paint paint, com.cyzapps.VisualMFP.Color newColor) {
    int nPaintOriginalColor = paint.getColor();
    Style stylePaintOriginalStyle = paint.getStyle();
    if (newColor != null) { // a valid color
        paint.setColor(newColor.getARGB());
    } else if (mcolorBkGrnd != null)    {
        paint.setColor(mcolorBkGrnd.getARGB());
    }
    paint.setStyle(Style.FILL);
    float fLeft = (float)x, fTop = (float)y, fRight = (float)(x + width), fBottom = (float)(y + height);
    canvas.drawRect(fLeft, fTop, fRight, fBottom, paint);
    // restore paint attribute.
    paint.setStyle(stylePaintOriginalStyle);
    paint.setColor(nPaintOriginalColor);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号