Package org.infoglue.deliver.util.graphics

Examples of org.infoglue.deliver.util.graphics.AdvancedImageRenderer


            uniqueId.append( "_" + Math.abs( text.hashCode() ));
            uniqueId.append( "_" + Math.abs(contentVersionVO.getVersionValue().hashCode() ) );
            uniqueId.append( "_" + Math.abs(contentTypeDefinitionVO.getSchemaValue().hashCode() ) );
            uniqueId.append( "_" + ( renderAttributes != null ? Math.abs( renderAttributes.hashCode() ) : 4711 ) );

            AdvancedImageRenderer imageRenderer = new AdvancedImageRenderer();
            // set up the renderer
            while ( attrIterator.hasNext() )
            {
                ContentTypeAttribute contentTypeAttribute = (ContentTypeAttribute)(attrIterator.next());
                String attributeName = contentTypeAttribute.getName();
                if ( imageRenderer.hasAttribute( attributeName ) )
                {
                    String attribute = cdc.getContentAttribute(getDatabase(), contentVersionVO, attributeName, false );
                    imageRenderer.setAttribute( attributeName.toLowerCase(), attribute );
                }
            }
            // render the image
            imageRenderer.renderImage( text, renderAttributes );
           
            String fileName = uniqueId + "." + imageRenderer.getImageFormatName()// default is png
            // write the result
            assetUrl = writeRenderedImage( imageRenderer, fileName );
        }
        catch ( Exception e )
        {
View Full Code Here


            aText = aText.substring( 0, ( aText.length() < 12 ? aText.length() : 11 ) ).toLowerCase();
            StringBuffer uniqueId = new StringBuffer( aText );
            uniqueId.append( "_" + Math.abs( text.hashCode() ) );
            uniqueId.append( "_" + ( renderAttributes != null ? Math.abs( renderAttributes.hashCode() ) : 4711 ) );

            AdvancedImageRenderer imageRenderer = new AdvancedImageRenderer();
            // render the image
            imageRenderer.renderImage( text, renderAttributes );
            if( distort )
            {
              uniqueId = new StringBuffer( "igcaptcha" );
                uniqueId.append( "_" + Math.abs( text.hashCode() ) );
                uniqueId.append( "_" + ( renderAttributes != null ? Math.abs( renderAttributes.hashCode() ) : 4711 ) );
              imageRenderer.distortImage();
            }

            String fileName = uniqueId + "." + imageRenderer.getImageFormatName()// default is png

            // write the result
            assetUrl = writeRenderedImage( imageRenderer, fileName );
        }
        catch ( Exception e )
View Full Code Here

TOP

Related Classes of org.infoglue.deliver.util.graphics.AdvancedImageRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.