Ask a Question related to PHP Development, Design and Development.
-
Martin #1
Problem with "imagerotate"
I posted this question a couple of weeks ago in comp.lang.php but
never got any responses:
-----------------------------------------------------------------
Does the gd "imagerotate" function in PHP5 work correctly or am I
doing something wrong?
I'm using the code shown below to generate a simple rectangle and then
to rotate it a specific number of degrees. The actual rotation itself
seems to happen OK but the background color appears correctly only if
the rotation is between 1 and 45 degrees; any other value and the
background is black. And, "imagecolortransparent" does not work at all
(I want the background to be transparent).
While trying to figure this out, I stumbled across the ImageMagick
library of routines. On their web site, one can actually manipulate an
image on-line. I was surprised to find that rotating an image there
seems to be limited to +/- 45 degrees also.
Is there any way I can rotate an image to, say, 60 degrees?
- - - - - - - - - - - - - - - - - - - - - - - - -
PHP code:
$myImg = imagecreate($somelength,$somewidth);
$myBG = imagecolorallocate($myImg,85,255,255);
$RectColor = imagecolorallocate($myImg,200,200,200);
$myBlack = imagecolorallocate($myImg, 0, 0, 0);
imagefilledrectangle($myImg,1,1,($somelength-2),($somewidth-2),
$RectColor);
imagerectangle($myImg,0,0,($somelength-1),($somewidth-1), $myBlack);
$myImage = imagerotate($myImg, $someangle, $myBG);
imagedestroy($myImg);
imagecolortransparent($myImage,$myBG);
imagepng($myImage,"gMyRect.png");
imagedestroy($myImage);
Martin Guest
-
Proj cannot run on LCDS 2.6 ES due to "Unable to resolveresource bundle "datamanagement" for locale "en_US"
hi, all, We have developped an application on Flex Build 3 (run successfully), but failed when we try to deploy it on Tomcat with LCDS 2.5 ES... -
Drag and drop problem with "dragEnabled" and"allowMultipleSelection"
Update 2, if it can help someone: Finally I don't manage the drag and drop by myself using DragManager.doDrag(...). Why? Because doing so if the... -
CFINPUT type="radio" w/ "value" requires "label"
On a Flash form, when you specify type='radio' and value='whatever', the value of the 'value' attribute will be displayed as a label if no 'label'... -
Problem with fopen("php://input", "r")
Hello there, I am having problem opening the in-built php stream php://input According to the manual this has been integrated into php since... -
"Start" "Program" "Menu" list is empty
For what ever reason my list of installed programs in my "Start" "Programs" menu is empty. Anyone know how to restore the list. Thanks for your...



Reply With Quote

