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


Java RenderableImage.createRendering方法代码示例

本文整理汇总了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);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:36,代码来源:GraphicsUtil.java

示例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);
}
 
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:36,代码来源:GraphicsUtil.java

示例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());
   }
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:35,代码来源:CompositeCRIF.java

示例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);
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:12,代码来源:RenderableCRIF.java


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