This is the complete code which displays the text perfectly in GREEN with NO
border.
I am at a loss.
Terry

<cfscript>
   width  = 330;
   height = 150;
   text   = "Crossfade";
    
   // Create a new image that supports transparency
   transparentImage = ImageNew("", width, height, "argb");
   graphics = ImageGetBufferedImage(transparentImage).createGraphics(); 
   
   // Add rendering hints to smooth text edges
   RenderingHints = createObject("java", "java.awt.RenderingHints");
   graphics.setRenderingHint(  RenderingHints.KEY_ANTIALIASING,
                               RenderingHints.VALUE_ANTIALIAS_ON
                            );
   graphics.setRenderingHint(   RenderingHints.KEY_RENDERING,
                               RenderingHints.VALUE_RENDER_QUALITY
                            );

   // Create a graphical representation of the text
   Font = createObject("java", "java.awt.Font");
   textFont = Font.init("Arial", Font.PLAIN, width / 5 );
   fontContext = graphics.getFontRenderContext();
   layout = createObject("java", "java.awt.font.TextLayout").init(text,
textFont, fontContext);

   // Center text outline 
   transX = (width/2) - (layout.getBounds().getWidth()/2);
   transY = (height/2) + layout.getDescent();
   transform = createObject("java", "java.awt.geom.AffineTransform").init();
   transform.setToTranslation( 5, 100 );

   // Draw the text outline onto the image
   shape = layout.getOutline(transform);
   
   // fill in the text
   Color = createObject("java", "java.awt.Color");
   graphics.setColor( Color.decode("##80aa1c") ); 
   graphics.fill( shape );
   
   // create a thin border 
   stroke = createObject("java", "java.awt.BasicStroke").init( 5 );
   graphics.dispose();
</cfscript>
<cfoutput>  
<!--- display raw image --->     
<cfimage source="#transparentImage#" action="writeToBrowser">  
<!--- display WITH background --->     
<div style="background-color: ##000080; width: #width#; height=#height#;">  
<cfimage source="#transparentImage#" action="writeToBrowser">  
</div>  
</cfoutput>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349972
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to