This is a discussion on image rotation with border within the PHP Programming forums, part of the Web Development category; hi fronds, while rotating image with border am getting poor border quality...angle apart from 90,180,270,360 causing ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| hi fronds, while rotating image with border am getting poor border quality...angle apart from 90,180,270,360 causing this problem.am creating borders using imageline function thanks in advance, venkatbi |
| Sponsored Links |
| |||
| Hi, It seems you are using imageline for drawing lines with specific colors. How you are rotating the image. Also, you are getting the poor quality only while rotating the image?. It would be better if you paste the sample code here.
__________________ None of us is As Strong as All of us. |
| |||
| hi anand, u r correct am using imageline or imagerectangle function to draw border.its working fine for angles 90,180,270 apart from these angles problem occurs... here is the sample code.. $image = imagecreatefromjpeg("samle.jpg"); $vX=imagesx($image); $vY=imagesy($image); $colour=imagecolorallocate($image, 0, 0, 0); imagesetthickness ($image,30); imagerectangle($image,0,0,$vX,$vY,$colour); $w = imagecolorallocate($image, 255, 255, 255); $red = imagecolorallocate($image, 255, 0, 0); /*$style = array($red, $red, $red, $red, $red, $red, $red, $red, $red, $red); imagesetstyle($image, $style); imageline($image, 0,0, $vX,0,IMG_COLOR_STYLED); imageline($image, 0,0, 0,$vY,IMG_COLOR_STYLED); imageline($image, 0,$vY,$vX,$vY,IMG_COLOR_STYLED); imageline($image,$vX,0,$vX,$vY,IMG_COLOR_STYLED);*/ $white = imagecolorallocate($image, 255, 255, 255); $rotateimage = imagerotate($image,45,$white); $white = imagecolorallocate($image, 255, 255, 255); $rotateimage1 =imagerotate($image,315,$white); $vBimg=imagecreatetruecolor(1750,1500); $whity= imagecolorallocate($vBimg, 255, 255, 255); imagefill ($vBimg,0,0,$whity); imagecolortransparent($vBimg,$whity); $imageWidthnew = imagesx($vBimg); $imageHeightnew = imagesy($vBimg); $colour11=imagecolorallocate($rotateimage, 255, 255, 255); imagecolortransparent($rotateimage,$colour11); $imageWidth1 = imagesx($rotateimage); $imageHeight1 = imagesy($rotateimage); imagecopymerge($vBimg,$rotateimage,0,0,0,0,$imageW idth1,$imageHeight1,100); //imagecopyresampled($vBimg,$rotateimage,0,0,0,0,$im ageWidth1,$imageHeight1,$imageWidth1,$imageHeight1 ); //imagecolorat($im, 10, 15); $colour12=imagecolorallocate($rotateimage1, 255,255,255); imagecolortransparent($rotateimage1,$colour12); $imageWidth2 = imagesx($rotateimage1); $imageHeight2= imagesy($rotateimage1); imagecopymerge($vBimg,$rotateimage1,100,0,0,0,$ima geWidth2,$imageHeight2,100); //imagecopyresampled($vBimg,$rotateimage1,0,0,0,0,$i mageWidth2,$imageHeight2,$imageWidth2,$imageHeight 2); header ("Content-type: image/jpeg"); imagejpeg($vBimg,"",100); imagedestroy($vBimg); this code ll create an image and it ll rotated in two different angles and then merged to another image one after another.. thanks, venkatbi |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DPI of an Image | Anandavinayagam | C# Programming | 6 | 12-12-2008 05:53 AM |
| Convert image to other image format using CODEC in .NET 3.0 | Mramesh | C# Programming | 0 | 02-07-2008 03:33 AM |
| How to create an image from panel background Image | S.Vinothkumar | C# Programming | 1 | 10-22-2007 03:52 AM |
| How to create textbox without border? | ramkumaraol | PHP Programming | 2 | 09-07-2007 06:13 AM |
| Better Image Format | Joe | Web Design Help | 12 | 03-06-2007 11:31 PM |