本文整理匯總了Java中java.awt.RenderingHints.get方法的典型用法代碼示例。如果您正苦於以下問題:Java RenderingHints.get方法的具體用法?Java RenderingHints.get怎麽用?Java RenderingHints.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.RenderingHints
的用法示例。
在下文中一共展示了RenderingHints.get方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: AffineTransformOp
import java.awt.RenderingHints; //導入方法依賴的package包/類
/**
* Constructs an <CODE>AffineTransformOp</CODE> given an affine transform.
* The interpolation type is determined from the
* <CODE>RenderingHints</CODE> object. If the interpolation hint is
* defined, it will be used. Otherwise, if the rendering quality hint is
* defined, the interpolation type is determined from its value. If no
* hints are specified (<CODE>hints</CODE> is null),
* the interpolation type is {@link #TYPE_NEAREST_NEIGHBOR
* TYPE_NEAREST_NEIGHBOR}.
*
* @param xform The <CODE>AffineTransform</CODE> to use for the
* operation.
*
* @param hints The <CODE>RenderingHints</CODE> object used to specify
* the interpolation type for the operation.
*
* @throws ImagingOpException if the transform is non-invertible.
* @see java.awt.RenderingHints#KEY_INTERPOLATION
* @see java.awt.RenderingHints#KEY_RENDERING
*/
public AffineTransformOp(AffineTransform xform, RenderingHints hints){
validateTransform(xform);
this.xform = (AffineTransform) xform.clone();
this.hints = hints;
if (hints != null) {
Object value = hints.get(hints.KEY_INTERPOLATION);
if (value == null) {
value = hints.get(hints.KEY_RENDERING);
if (value == hints.VALUE_RENDER_SPEED) {
interpolationType = TYPE_NEAREST_NEIGHBOR;
}
else if (value == hints.VALUE_RENDER_QUALITY) {
interpolationType = TYPE_BILINEAR;
}
}
else if (value == hints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR) {
interpolationType = TYPE_NEAREST_NEIGHBOR;
}
else if (value == hints.VALUE_INTERPOLATION_BILINEAR) {
interpolationType = TYPE_BILINEAR;
}
else if (value == hints.VALUE_INTERPOLATION_BICUBIC) {
interpolationType = TYPE_BICUBIC;
}
}
else {
interpolationType = TYPE_NEAREST_NEIGHBOR;
}
}
示例2: AffineTransformOp
import java.awt.RenderingHints; //導入方法依賴的package包/類
/**
* Constructs an {@code AffineTransformOp} given an affine transform.
* The interpolation type is determined from the
* {@code RenderingHints} object. If the interpolation hint is
* defined, it will be used. Otherwise, if the rendering quality hint is
* defined, the interpolation type is determined from its value. If no
* hints are specified ({@code hints} is null),
* the interpolation type is {@link #TYPE_NEAREST_NEIGHBOR
* TYPE_NEAREST_NEIGHBOR}.
*
* @param xform The {@code AffineTransform} to use for the
* operation.
*
* @param hints The {@code RenderingHints} object used to specify
* the interpolation type for the operation.
*
* @throws ImagingOpException if the transform is non-invertible.
* @see java.awt.RenderingHints#KEY_INTERPOLATION
* @see java.awt.RenderingHints#KEY_RENDERING
*/
public AffineTransformOp(AffineTransform xform, RenderingHints hints){
validateTransform(xform);
this.xform = (AffineTransform) xform.clone();
this.hints = hints;
if (hints != null) {
Object value = hints.get(RenderingHints.KEY_INTERPOLATION);
if (value == null) {
value = hints.get(RenderingHints.KEY_RENDERING);
if (value == RenderingHints.VALUE_RENDER_SPEED) {
interpolationType = TYPE_NEAREST_NEIGHBOR;
}
else if (value == RenderingHints.VALUE_RENDER_QUALITY) {
interpolationType = TYPE_BILINEAR;
}
}
else if (value == RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR) {
interpolationType = TYPE_NEAREST_NEIGHBOR;
}
else if (value == RenderingHints.VALUE_INTERPOLATION_BILINEAR) {
interpolationType = TYPE_BILINEAR;
}
else if (value == RenderingHints.VALUE_INTERPOLATION_BICUBIC) {
interpolationType = TYPE_BICUBIC;
}
}
else {
interpolationType = TYPE_NEAREST_NEIGHBOR;
}
}