Question : creating image using coldfusion

Looking to create a Rectangle of 20*20 pixels in which i should create the topleft side of the rectangle as rounded and color with my choice..

The demo is attached with this email what kind of thing i am looking for.

I think if we create one, we can use the imageflip function to rotate it left/right/top/bottom all along
Attachments:
 
image
image
 

Answer : creating image using coldfusion

The easier way is to draw the whole rounded rectangle with the colors you want.  Adjust the arc values +/- until it looks the way you want.

<!--- draw rounded rectangle. adjust the curves however you want --->
<!--- ImageDrawRoundRect(name, x, y, width, height, arcWidth, arcHeight [, filled]) --->
<cfset img = ImageNew("", 40, 40, "rgb", "blue")>
<cfset ImageSetAntialiasing(img, "on")>
<cfset ImageSetDrawingColor(img, "white") />
<cfset ImageDrawRoundRect(img, 0, 0, 40, 40, 40, 40,"yes")>

<div style="background-color: red;">
Whole image<br> <cfimage action="writeToBrowser" source="#img#">
</div>

Then chop it into 4 pieces (ie top left corner, top right corner, etc...) and just use the ones you want.

<!--- ImageCopy(name, x, y, width, height) --->
<cfset topLeft = ImageCopy(img, 0, 0, 20, 20)>
<cfset topRight = ImageCopy(img, 20, 0, 20, 20)>
<cfset botLeft = ImageCopy(img, 0, 20, 20, 20)>
<cfset botRight = ImageCopy(img, 20, 20, 20, 20)>

<div style="background-color: red;">
Pieces <br>
<cfimage action="writeToBrowser" source="#topLeft#">
<cfimage action="writeToBrowser" source="#topRight#"><br>
<cfimage action="writeToBrowser" source="#botLeft#">
<cfimage action="writeToBrowser" source="#botRight#">
</div>
Random Solutions  
 
programming4us programming4us