java.awt.Graphics2D.getRenderingHints()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中java.awt.Graphics2D.getRenderingHints()方法的一些代码示例,展示了Graphics2D.getRenderingHints()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graphics2D.getRenderingHints()方法的具体详情如下:
包路径:java.awt.Graphics2D
类名称:Graphics2D
方法名:getRenderingHints

Graphics2D.getRenderingHints介绍

暂无

代码示例

代码示例来源:origin: org.apache.poi/poi

public RenderingHints getRenderingHints()
{
  return getG2D().getRenderingHints();
}

代码示例来源:origin: org.apache.poi/poi

/**
 * Compute the cumulative height occupied by the text
 *
 * @param oldGraphics the graphics context, which properties are to be copied, may be null
 * @return the height in points
 */
public double getTextHeight(Graphics2D oldGraphics) {
  // dry-run in a 1x1 image and return the vertical advance
  BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);
  Graphics2D graphics = img.createGraphics();
  if (oldGraphics != null) {
    graphics.addRenderingHints(oldGraphics.getRenderingHints());
    graphics.setTransform(oldGraphics.getTransform());
  }
  DrawFactory.getInstance(graphics).fixFonts(graphics);
  return drawParagraphs(graphics, 0, 0);
}

代码示例来源:origin: apache/pdfbox

@Override
public RenderingHints getRenderingHints()
{
  return groupG2D.getRenderingHints();
}

代码示例来源:origin: geotools/geotools

public RenderingHints getRenderingHints() {
  return delegate.getRenderingHints();
}

代码示例来源:origin: geotools/geotools

/** Call this method before starting to use the graphic for good */
public void init() {
  if (delegate == null) {
    if (master instanceof DelayedBackbufferGraphic) {
      ((DelayedBackbufferGraphic) master).init();
    }
    image =
        master.getDeviceConfiguration()
            .createCompatibleImage(
                screenSize.width, screenSize.height, Transparency.TRANSLUCENT);
    delegate = image.createGraphics();
    delegate.setRenderingHints(master.getRenderingHints());
  }
}

代码示例来源:origin: geotools/geotools

RenderedImage inputImage,
  final RasterSymbolizer symbolizer) {
final RenderingHints oldHints = graphics.getRenderingHints();
graphics.setRenderingHints(this.hints);

代码示例来源:origin: org.apache.pdfbox/pdfbox

@Override
public RenderingHints getRenderingHints()
{
  return groupG2D.getRenderingHints();
}

代码示例来源:origin: com.samskivert/samskivert

@Override
public RenderingHints getRenderingHints ()
{
  return _primary.getRenderingHints();
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/napkinlaf

/** {@inheritDoc} */
@Override
public RenderingHints getRenderingHints() {
  return g2d.getRenderingHints();
}

代码示例来源:origin: us.ihmc/ihmc-graphics-description

public RenderingHints getRenderingHints()
{
 return graphics2d.getRenderingHints();
}

代码示例来源:origin: us.ihmc/IHMCGraphicsDescription

public RenderingHints getRenderingHints()
{
 return graphics2d.getRenderingHints();
}

代码示例来源:origin: org.openmicroscopy/ome-poi

public RenderingHints getRenderingHints()
{
  System.out.println( "getRenderingHints():" );
  return g2D.getRenderingHints();
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

public RenderingHints getRenderingHints()
{
  System.out.println( "getRenderingHints():" );
  return g2D.getRenderingHints();
}

代码示例来源:origin: com.samskivert/samskivert

public void paintIcon (Component c, Graphics g, int x, int y)
{
  Graphics2D gfx = (Graphics2D) g;
  AffineTransform otrans = gfx.getTransform();
  RenderingHints ohints = gfx.getRenderingHints();
  gfx.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
    RenderingHints.VALUE_INTERPOLATION_BILINEAR);
  gfx.scale(_scale, _scale);
  _icon.paintIcon(c, g, x, y);
  gfx.setTransform(otrans);
  gfx.setRenderingHints(ohints);
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-common

public static void setBestQuality(final Graphics2D _g) {
 _g.getRenderingHints().put(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
 _g.getRenderingHints().put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
 _g.getRenderingHints().put(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
 _g.getRenderingHints()
   .put(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
 _g.getRenderingHints().put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
 _g.getRenderingHints().put(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
 _g.getRenderingHints().put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
}

代码示例来源:origin: JetBrains/jediterm

public GraphicsConfig(Graphics g) {
 myG = (Graphics2D)g;
 myHints = (Map)myG.getRenderingHints().clone();
 myComposite = myG.getComposite();
}

代码示例来源:origin: org.geotools/gt-render

/**
 * Call this method before starting to use the graphic for good
 */
public void init() {
  if (delegate == null) {
    image = master.getDeviceConfiguration().createCompatibleImage(screenSize.width,
        screenSize.height, Transparency.TRANSLUCENT);
    delegate = image.createGraphics();
    delegate.setRenderingHints(master.getRenderingHints());
  }
}

代码示例来源:origin: robo-code/robocode

public void save(Graphics g) {
  Graphics2D g2 = (Graphics2D) g;
  paint = g2.getPaint();
  font = g2.getFont();
  stroke = g2.getStroke();
  transform = g2.getTransform();
  composite = g2.getComposite();
  clip = g2.getClip();
  renderingHints = g2.getRenderingHints();
  color = g2.getColor();
  background = g2.getBackground();
}

代码示例来源:origin: com.numdata/numdata-swing

@Override
protected void paintComponent( final Graphics g )
{
  final Graphics2D g2d = (Graphics2D)g;
  final RenderingHints oldHints = g2d.getRenderingHints();
  g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
  super.paintComponent( g );
  g2d.setRenderingHints( oldHints );
}

代码示例来源:origin: stackoverflow.com

Graphics2D g2 = (Graphics2D) g;
RenderingHints rh = g2.getRenderingHints ();
rh.put (RenderingHints.KEY_ANTIALIASING,
    RenderingHints.VALUE_ANTIALIAS_ON);
g2.setRenderingHints (rh);

相关文章

Graphics2D类方法