com.sksamuel.scrimage.graphics.Graphics2DUtils Maven / Gradle / Ivy
package com.sksamuel.scrimage.graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
public class Graphics2DUtils {
public static void setAntiAlias(Graphics2D g2, boolean aa) {
if (aa) {
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
} else {
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy