Gayner Posted November 15, 2009 Share Posted November 15, 2009 i want to use a div tag instead? like this: http://forums.d2jsp.org/register.php?a=1&i=5e51794914805f1eaf481fcbafdc29f1 if u got here there's no background image, just a css tag applied with a nice blue background borders. I have that css tag, but this is my code to try to make it a css tag instead of background image. session_start(); $RandomStr = md5(microtime());// md5 to generate the random string $ResultStr = substr($RandomStr,0,5);//trim 5 digit $NewImage = imagecreatefromjpeg("img.jpg");//image create by existing image and as back ground $LineColor = imagecolorallocate($NewImage,553,539,239);//line color $LineColor = imagecolorallocate($NewImage,223,539,239);//line color $TextColor = imagecolorallocate($NewImage, 255, 255, 255);//text color-white imageline($NewImage,1,1,40,40,$LineColor);//create line 1 on image imageline($NewImage,1,100,60,0,$LineColor);//create line 2 on image imageline($NewImage,1,500,20,0,$LineColor2);//create line 3 on image imagestring($NewImage, 5, 20, 10, $ResultStr, $TextColor);// Draw a random string horizontally $_SESSION['key'] = $ResultStr;// carry the data through session header("Content-type: image/jpeg");// out out the image imagejpeg($NewImage);//Output image to browser thx Quote Link to comment https://forums.phpfreaks.com/topic/181569-i-dont-want-to-use-imagecreatefromjpegimgjpg/ Share on other sites More sharing options...
Alex Posted November 15, 2009 Share Posted November 15, 2009 I'm not really sure what you're asking, can you try to explain your question better please? Quote Link to comment https://forums.phpfreaks.com/topic/181569-i-dont-want-to-use-imagecreatefromjpegimgjpg/#findComment-957701 Share on other sites More sharing options...
Gayner Posted November 15, 2009 Author Share Posted November 15, 2009 I'm not really sure what you're asking, can you try to explain your question better please? Like on that http://forums.d2jsp.org/register.php?a=1&i=8b0135f3acf84ef965d5d0cc5a0ea9b7 it doesnt have a background image? I just want my script to shoot out the text. not without a background image, lol. I want to apply a div tag behind the captcha instead of a image. Quote Link to comment https://forums.phpfreaks.com/topic/181569-i-dont-want-to-use-imagecreatefromjpegimgjpg/#findComment-957702 Share on other sites More sharing options...
Alex Posted November 15, 2009 Share Posted November 15, 2009 That image does have background image though.. Anyway, you mean you just want a transparent background right? imagecolortransparent() Quote Link to comment https://forums.phpfreaks.com/topic/181569-i-dont-want-to-use-imagecreatefromjpegimgjpg/#findComment-957705 Share on other sites More sharing options...
Gayner Posted November 15, 2009 Author Share Posted November 15, 2009 That image does have background image though.. Anyway, you mean you just want a transparent background right? imagecolortransparent() Yea but how'd he get blue border on it and.. I want letters to be spaced.. ? Quote Link to comment https://forums.phpfreaks.com/topic/181569-i-dont-want-to-use-imagecreatefromjpegimgjpg/#findComment-957706 Share on other sites More sharing options...
Alex Posted November 15, 2009 Share Posted November 15, 2009 His background image probably includes the border, and each character is probably drawn separate rather than in a single string. Quote Link to comment https://forums.phpfreaks.com/topic/181569-i-dont-want-to-use-imagecreatefromjpegimgjpg/#findComment-957707 Share on other sites More sharing options...
Gayner Posted November 15, 2009 Author Share Posted November 15, 2009 His background image probably includes the border, and each character is probably drawn separate rather than in a single string. i found 1 $text = rand(10000,99999); $_SESSION["vercode"] = $text; $height = 25; $width = 65; $image_p = imagecreate($width, $height); $black = imagecolorallocate($image_p, 0, 0, 0); $white = imagecolorallocate($image_p, 255, 255, 255); $font_size = 14; imagestring($image_p, $font_size, 5, 5, $text, $white); imagejpeg($image_p, null, 80); works Quote Link to comment https://forums.phpfreaks.com/topic/181569-i-dont-want-to-use-imagecreatefromjpegimgjpg/#findComment-957713 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.