Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function __vertical( $name, $text ) {
- $DRoot = $_SERVER['DOCUMENT_ROOT'] ;
- // Подключаем шрифт
- $font = $DRoot."/fonts/arial.ttf" ;
- $im = ImageCreate( 190, 20 ) ;
- $background_color = ImageColorAllocate( $im, 255, 255, 255 ) ;
- $text_color = ImageColorAllocate($im, 0, 0, 0 ) ;
- // Рисуем текст на картинке
- ImageTTFText( $im , 12 , 0, 2, 15, $text_color, $font, $text ) ;
- ImagePNG( $im, $DRoot."/temp/cache.png") ;
- // Переворачиваем картинку на 90 градусов
- $im2 = imagerotate( $im, 90, 0 ) ;
- // А может картинку уже существует? Проверяем.
- if( !file_exists( $DRoot.'/images/vert_'.$name.'.png' ) ) {
- ImagePNG($im2, $DRoot.'/images/vert_'.$name.'.png' ) ;
- ImageDestroy( $im2 ) ;
- }
- ImageDestroy( $im ) ;
- // Удаляем временное изображение
- if( file_exists( DRoot.'/temp/cache.png' ) ) {
- unlink( DRoot.'/temp/cache.png' ) ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement