/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $image_file = $_GET['src']; $corner_radius = isset($_GET['radius']) ? $_GET['radius'] : 20; // The default corner radius is set to 20px $topleft = (isset($_GET['topleft']) and $_GET['topleft'] == "no") ? false : true; // Top-left rounded corner is shown by default $bottomleft = (isset($_GET['bottomleft']) and $_GET['bottomleft'] == "no") ? false : true; // Bottom-left rounded corner is shown by default $bottomright = (isset($_GET['bottomright']) and $_GET['bottomright'] == "no") ? false : true; // Bottom-right rounded corner is shown by default $topright = (isset($_GET['topright']) and $_GET['topright'] == "no") ? false : true; // Top-right rounded corner is shown by default $backcolor=$_GET['backcolor']; $endsize=$corner_radius; $startsize=$endsize*3-1; $arcsize=$startsize*2+1; if (($imagetype=='jpeg') or ($imagetype=='jpg')) { } else { if (($imagetype=='GIF') or ($imagetype=='gif')) { } else { } } // Top-left corner $startx=$size[0]*2-1; $starty=$size[1]*2-1; if ($topleft == true) { } // Bottom-left corner if ($bottomleft == true) { } // Bottom-right corner if ($bottomright == true) { } // Top-right corner if ($topright == true) { } // Output final image ?>
URL: http://it.toolbox.com/blogs/opensource-programming/rounded-corners-on-images-22705