当前位置: 首页>>代码示例>>Java>>正文


Java RenderingHints.VALUE_ANTIALIAS_OFF属性代码示例

本文整理汇总了Java中java.awt.RenderingHints.VALUE_ANTIALIAS_OFF属性的典型用法代码示例。如果您正苦于以下问题:Java RenderingHints.VALUE_ANTIALIAS_OFF属性的具体用法?Java RenderingHints.VALUE_ANTIALIAS_OFF怎么用?Java RenderingHints.VALUE_ANTIALIAS_OFF使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.awt.RenderingHints的用法示例。


在下文中一共展示了RenderingHints.VALUE_ANTIALIAS_OFF属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    if (source == cmbPaint) {
        paintType = (PaintType)cmbPaint.getSelectedItem();
    } else if (source == cmbCycle) {
        cycleMethod = (CycleMethod)cmbCycle.getSelectedItem();
    } else if (source == cmbSpace) {
        colorSpace = (ColorSpaceType)cmbSpace.getSelectedItem();
    } else if (source == cmbShape) {
        shapeType = (ShapeType)cmbShape.getSelectedItem();
    } else if (source == cmbXform) {
        xformType = (XformType)cmbXform.getSelectedItem();
    } else if (source == cbAntialias) {
        antialiasHint = cbAntialias.isSelected() ?
            RenderingHints.VALUE_ANTIALIAS_ON :
            RenderingHints.VALUE_ANTIALIAS_OFF;
    } else if (source == cbRender) {
        renderHint = cbRender.isSelected() ?
            RenderingHints.VALUE_RENDER_QUALITY :
            RenderingHints.VALUE_RENDER_SPEED;
    }

    gradientPanel.updatePaint();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:25,代码来源:MultiGradientTest.java

示例2: render

@Override
public BufferedImage render(final BufferedImage baseImage) {

    int width = baseImage.getWidth();
    int height = baseImage.getHeight();

    // create an opaque image
    RenderingHints hints = new RenderingHints(
            RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_OFF);

    hints.add(new RenderingHints(RenderingHints.KEY_COLOR_RENDERING,
            RenderingHints.VALUE_COLOR_RENDER_QUALITY));
    hints.add(new RenderingHints(RenderingHints.KEY_ALPHA_INTERPOLATION,
            RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY));

    hints.add(new RenderingHints(RenderingHints.KEY_RENDERING,
            RenderingHints.VALUE_RENDER_QUALITY));

    BufferedImage imageWithBackground = new BufferedImage(width, height,
            BufferedImage.TYPE_INT_RGB);

    Graphics2D graph = (Graphics2D) imageWithBackground.getGraphics();
    graph.setRenderingHints(hints);
    graph.setPaint(new GradientPaint(0, 0, colorFrom, width, height, colorTo));
    graph.fill(new Rectangle2D.Double(0, 0, width, height));
    graph.drawImage(baseImage, 0, 0, null);
    graph.dispose();

    return imageWithBackground;
}
 
开发者ID:febit,项目名称:febit,代码行数:31,代码来源:GradientBackgroundFilter.java


注:本文中的java.awt.RenderingHints.VALUE_ANTIALIAS_OFF属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。