Terry,   

I do not see anything obviously wrong. Other than the very last line, it looks 
the same. Here is the complete test code I used on CF8/CF9.  The result is 
green text with a purple-ish border

-Leigh


<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( 1 );
   graphics

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:349968
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to