本文整理汇总了Java中java.awt.image.renderable.RenderableImage.createRendering方法的典型用法代码示例。如果您正苦于以下问题:Java RenderableImage.createRendering方法的具体用法?Java RenderableImage.createRendering怎么用?Java RenderableImage.createRendering使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.image.renderable.RenderableImage
的用法示例。
在下文中一共展示了RenderableImage.createRendering方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawImage
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
/**
* Draws a <code>Filter</code> (<code>RenderableImage</code>) into a
* Graphics 2D.<p>
*
* This method also attempts to unwind the rendering chain a bit.
* So it knows about certain operations (like affine, pad,
* composite), rather than applying each of these operations in
* turn it accounts for their affects through modifications to the
* Graphics2D. This avoids generating lots of intermediate images.
*
* @param g2d The Graphics to draw into.
* @param filter The filter to draw
*/
public static void drawImage(Graphics2D g2d,
RenderableImage filter) {
if (filter instanceof PaintRable) {
PaintRable pr = (PaintRable)filter;
if (pr.paintRable(g2d))
// paintRable succeeded so we are done...
return;
}
// Get our sources image...
// System.out.println("UnOpt: " + filter);
AffineTransform at = g2d.getTransform();
RenderedImage ri = filter.createRendering
(new RenderContext(at, g2d.getClip(), g2d.getRenderingHints()));
if (ri == null)
return;
g2d.setTransform(IDENTITY);
drawImage(g2d, GraphicsUtil.wrap(ri));
g2d.setTransform(at);
}
示例2: drawImage
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
/**
* Draws a <tt>Filter</tt> (<tt>RenderableImage</tt>) into a
* Graphics 2D.<p>
*
* This method also attempts to unwind the rendering chain a bit.
* So it knows about certain operations (like affine, pad,
* composite), rather than applying each of these operations in
* turn it accounts for their affects through modifications to the
* Graphics2D. This avoids generating lots of intermediate images.
*
* @param g2d The Graphics to draw into.
* @param filter The filter to draw
*/
public static void drawImage(Graphics2D g2d,
RenderableImage filter) {
if (filter instanceof PaintRable) {
PaintRable pr = (PaintRable)filter;
if (pr.paintRable(g2d))
// paintRable succeeded so we are done...
return;
}
// Get our sources image...
// System.out.println("UnOpt: " + filter);
AffineTransform at = g2d.getTransform();
RenderedImage ri = filter.createRendering
(new RenderContext(at, g2d.getClip(), g2d.getRenderingHints()));
if (ri == null)
return;
g2d.setTransform(IDENTITY);
drawImage(g2d, GraphicsUtil.wrap(ri));
g2d.setTransform(at);
}
示例3: create
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
/**
* Creates a <Code>RenderedImage</Code> from the renderable layer.
*
* @param renderContext The rendering information associated with
* this rendering.
* @param paramBlock The parameters used to create the image.
* @return A <code>RenderedImage</code>.
*/
public RenderedImage create(RenderContext renderContext,
ParameterBlock paramBlock) {
// Get the two renderable alpha images from the parameter block
RenderableImage alphaImage1 =
(RenderableImage)paramBlock.getObjectParameter(0);
RenderableImage alphaImage2 =
(RenderableImage)paramBlock.getObjectParameter(1);
// Cause the two renderable alpha images to be rendered
RenderedImage rAlphaImage1 =
alphaImage1.createRendering(renderContext);
RenderedImage rAlphaImage2 =
alphaImage2.createRendering(renderContext);
ParameterBlock newPB = (ParameterBlock)paramBlock.clone();
// Replace the renderable alpha images in the ParameterBlock with
// their renderings
newPB.set(rAlphaImage1, 0);
newPB.set(rAlphaImage2, 1);
// Return JAI.create("composite")
return JAI.create("composite", newPB,
renderContext.getRenderingHints());
}
示例4: create
import java.awt.image.renderable.RenderableImage; //导入方法依赖的package包/类
/**
* Creates a new instance of <code>AffineOpImage</code>
* in the renderable layer. This method satisfies the
* implementation of CRIF.
*/
public RenderedImage create(RenderContext renderContext,
ParameterBlock paramBlock) {
RenderableImage mres = createRenderable(paramBlock);
return mres.createRendering(renderContext);
}