Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include ('mysql.php');
- $vetrina_query=mysql_query("SELECT * FROM professionisti_pagina WHERE logo='' LIMIT 1");
- while($vetrina_row=mysql_fetch_array($vetrina_query))
- {
- $my_img = imagecreatetruecolor(200, 200);
- imagesavealpha($my_img, true);
- $color = imagecolorallocatealpha($my_img, 0, 0, 0, 127);
- imagefill($my_img, 0, 0, $color);
- $font='/var/www/vhosts/ns3000093.ovh.net/site1/img/loghi_gen_base/1.ttf';
- $text='mirko quotalo associazione';
- $text_box = imagettfbbox(10,0,$font,$text);
- $text_width = $text_box[2]-$text_box[0];
- $text_height = $text_box[7]-$text_box[1];
- $x = (200/2) - ($text_width/2);
- $y = (140) - ($text_height/2);
- $black = imagecolorallocate($my_img, 0, 0, 0);
- imagettftext($my_img, 10, 0, $x, $y, $black, $font, $text);
- imagettftext($my_img, 10, 0, $x, $y+20, $black, $font, $text);
- imagettftext($my_img, 10, 0, $x, $y+40, $black, $font, $text);
- imagepng( $my_img, '/var/www/vhosts/ns3000093.ovh.net/site1/img/loghi_gen_base/temp.png');
- // Create image instances
- $src = imagecreatefromjpeg('/var/www/vhosts/ns3000093.ovh.net/site1/img/loghi_gen_base/0001.jpg');
- $dest = imagecreatefrompng('/var/www/vhosts/ns3000093.ovh.net/site1/img/loghi_gen_base/temp.png');
- // Copy
- imagecopy($dest, $src, 42, 10, 0, 0, 115, 115);
- // Output and free from memory
- imagepng($dest,'/var/www/vhosts/ns3000093.ovh.net/site1/img/loghi_gen_base/merged.png');
- /*$my_img = imagecreate( 200, 200 );
- $background = imagecolorallocate( $my_img, 255, 255, 255 );
- imagejpeg( $my_img,'/var/www/vhosts/ns3000093.ovh.net/site1/img/loghi_gen_base/merged.jpg' );
- imagedestroy( $my_img );*/
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement