Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- renderCaptcha($code: 'test');
- function renderCaptcha($code){
- $im = imagecreatetruecolor(width: 300, height: 300);
- //RGB
- $backColor = imagecolorallocate(image: $im, red: 255, green: 224, blue: 221);
- $textColor = imagecolorallocate(image: $im, red: 129, green: 15, blue: 90);
- $fontFile = '/font/OpenSans-Regular.ttf';
- $imBox = imagecreatefrompng(filename: '/font/bmw_PNG1709.png')
- imagefill($image: $im, x:0, y:0, color: $backColor);
- imagecopy(dst_im: $im, src_im: $imBox, dst_x: 10, dst_y: 10, src_x: 0, src_y: 0, src_w: 256, src_h: 256);
- imagettftext(image: $im, size: 25, angle: 0, x: 30, y: 30, color: $textColor, fontFile: $fontFile, text: $code);
- imagepng($im);
- imagedestroy($im);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement