IT Community - Software Programming, Web Development and Technical Support

image rotation with border

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 ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-16-2007, 05:49 AM
venkatbi venkatbi is offline
D-Web Programmer
 
Join Date: Jul 2007
Posts: 80
venkatbi is on a distinguished road
Question image rotation with border

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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-20-2007, 07:39 AM
Anand Anand is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 52
Anand is on a distinguished road
Default Re: image rotation with border

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.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-20-2007, 11:16 PM
venkatbi venkatbi is offline
D-Web Programmer
 
Join Date: Jul 2007
Posts: 80
venkatbi is on a distinguished road
Default Re: image rotation with border

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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -7. The time now is 02:54 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0