info();
$vitae['Experience'] = $Programmer->Experience();
$vitae['Introduction'] = $Programmer->Introduction();
$vitae['Item'] = $Programmer->Item();
new Img($vitae);
}
class Img{
const imgWidth = '1700';
const imgHeight = '1600';
const font_file = "c:\\WINDOWS\\Fonts\\simhei.ttf"; //LINUX自己换字体
function __construct($content){
$img = imagecreate(Img::imgWidth, Img::imgHeight);
imagecolorallocate($img, 255, 255, 255);
$color = imagecolorallocate($img,0,0,0);
$this->table($img , $color);
$this->photo($img , $color);
$this->title($img , $color);
$this->info($img , $content['Info'] , $color);
$this->Introduction($img , $content['Introduction'] , $color);
$this->Experience($img , $content['Experience'] , $color);
$this->Item($img , $content['Item'] , $color);
$this->wateryin($img , $color);
imagepng($img);
}
public function table($img , $color){
imageline($img , 300 , 50 , 300 , Img::imgHeight - 50 , $color); //左边界
imageline($img , Img::imgWidth - 300 , 50 , Img::imgWidth - 300 , Img::imgHeight - 50 , $color); //右边界
imageline($img , 300 , 50 , Img::imgWidth - 300 , 50 , $color); //上边界
imageline($img , 300 , Img::imgHeight - 50 , Img::imgWidth - 300 , Img::imgHeight - 50 , $color); //下边界
imageline($img , 300 , 130 , Img::imgWidth - 300 , 130 , $color); //标题
imageline($img , 300 , 190 , Img::imgWidth - 500 , 190 , $color); //第一行
imageline($img , 300 , 250 , Img::imgWidth - 500 , 250 , $color); //第二行
imageline($img , 300 , 310 , Img::imgWidth - 300 , 310 , $color); //第三行
imageline($img , 300 , 360 , Img::imgWidth - 300 , 360 , $color); //第三行
imageline($img , Img::imgWidth-500 , 130 , Img::imgWidth - 500 , 310 , $color); //photo
imageline($img , Img::imgWidth-1100 , 130 , Img::imgWidth - 1100 , 310 , $color); //竖线
imageline($img , Img::imgWidth-780 , 130 , Img::imgWidth - 780 , 310 , $color); //竖线
imageline($img , 300 , 710 , Img::imgWidth - 300 , 710 , $color); //第四行(介绍)
imageline($img , 300 , 760 , Img::imgWidth - 300 , 760 , $color); //第四行(介绍)
imageline($img , 300 , 1110 , Img::imgWidth - 300 , 1110 , $color); //第五行(介绍)
imageline($img , 300 , 1160 , Img::imgWidth - 300 , 1160 , $color); //第四行(介绍)
}
public function photo($img , $color){
imageellipse($img, 1260, 180, 60, 40,$color); //左眼
imageellipse($img, 1340, 180, 60, 40,$color); //右眼
imagearc($img, 1300, 180, 30, 20,30,150,$color); //眼镜
imagearc($img, 1350, 140, 80, 100,0,60,$color);
imagearc($img, 1235, 130, 50, 110,100,160,$color);
imagearc($img, 1300, 230, 100, 100, 20, 160,$color); //以下是嘴巴
imagearc($img, 1290, 240, 130, 20, 20, 125,$color);
imagerectangle($img, 1290, 250, 1280, 260,$color);
imagerectangle($img, 1305, 250, 1295, 260,$color);
imagerectangle($img, 1310, 250, 1320, 260,$color);
}
public function title($img , $color){
imagettftext($img, 20, 0, 780 ,100, $color, Img::font_file, '程序员简历');
imagettftext($img, 20, 0, 790 ,345, $color, Img::font_file, '工作经历');
imagettftext($img, 20, 0, 790 ,745, $color, Img::font_file, '项目经验');
imagettftext($img, 20, 0, 790 ,1145, $color, Img::font_file, '个人简介');
}
public function info($img , $info , $color){
foreach($info as $key=>$value){
switch ($key){
case "Name":
imagettftext($img, 15, 0, 350 ,170, $color, Img::font_file, "{$key}:{$value}"); //姓名
break;
case "Age":
imagettftext($img, 15, 0, 630 ,170, $color, Img::font_file, "{$key}:{$value}"); //年龄
break;
case "Gender":
imagettftext($img, 15, 0, 950 ,170, $color, Img::font_file, "{$key}:{$value}"); //性别
break;
case "EnglisNname":
imagettftext($img, 15, 0, 350 ,230, $color, Img::font_file, "{$key}:{$value}"); //English Name
break;
case "University":
imagettftext($img, 15, 0, 630 ,230, $color, Img::font_file, "{$key}:{$value}"); //毕业院校
break;
case "Major":
imagettftext($img, 15, 0, 950 ,230, $color, Img::font_file, "{$key}:{$value}"); //专业
break;
case "LivingPlace":
imagettftext($img, 15, 0, 350 ,290, $color, Img::font_file, "{$key}:{$value}"); //现居地
break;
case "Phone":
imagettftext($img, 15, 0, 630 ,290, $color, Img::font_file, "{$key}:{$value}"); //电话
break;
case "Email":
imagettftext($img, 15, 0, 950 ,290, $color, Img::font_file, "{$key}:{$value}"); //Email
break;
}
}
}
public function Introduction($img , $Introduction , $color){
$str = explode('' , $Introduction);
foreach($str as $key=>$value){
imagettftext($img, 14, 0, 350 ,1200+$a*35, $color, Img::font_file, $value);
$a++;
}
}
public function Experience($img , $Experience , $color){
foreach($Experience as $key=>$value){
imagettftext($img, 14, 0, 350 ,400+$a*35, $color, Img::font_file, $key);
imagettftext($img, 14, 0, 750 ,400+$a*35, $color, Img::font_file, $value);
$a++;
}
}
public function Item($img , $Item , $color){
$str = explode('' , $Item);
foreach($str as $key=>$value){
imagettftext($img, 14, 0, 350 ,800+$a*35, $color, Img::font_file, $value);
$a++;
}
}
public function wateryin($img , $color){
$str = 'by:hackpar';
imagettftext($img, 14, 0, 1450 ,1550, $color, Img::font_file, $str);
}
}
class Programmer{
const Name = 'ZJD';
const Gender = 'Male';
const Age = '21';
const Englishname = 'Hackpar';
const University = "";
const Major = 'Software';
const LivingPlace = "Xi'an";
const Phone = '';
const Email = 'hackpar@gmail.com';
public function info(){
$info = array(
'Name' => Programmer::Name,
'Gender' => Programmer::Gender,
'Age' => Programmer::Age,
'EnglisNname' => Programmer::Englishname,
'University' => Programmer::University,
'Major' => Programmer::Major,
'LivingPlace' => Programmer::LivingPlace,
'Phone' => Programmer::Phone,
'Email' => Programmer::Email,
);
return $info;
}
public function Experience(){
$exp = array();
$exp['2011-04 to 2011-10'] = '';
$exp['2012-02 to 2012-12'] = '';
$exp['2013-03 to 2013-06'] = '';
$exp['2013-07 to now'] = '';
return $exp;
}
public function Introduction(){
$int = '一个苦逼的PHP码农,没有Geek的技术,但是有一颗Geek的心.';
return $int;
}
public function Item(){
$item = '项目介绍';
return $item;
}
}
?> 0
0
本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门AI工具
相关专题
本专题汇总了包子漫画官网和网页版入口,提供最新章节抢先看方法、正版免费阅读指南,以及稳定访问方式,帮助用户快速直达包子漫画页面,无广告畅享全集漫画内容。
47
2026.02.10
本专题汇总了MC.JS官网入口和网页版快速畅玩方法,提供免安装访问、不同版本(1.8.8、1.12.8)在线体验指南,以及正版网页端操作说明,帮助玩家轻松进入MC.JS世界,实现即时畅玩与高效体验。
34
2026.02.10
本专题汇总了谷歌邮箱网页版的最新登录入口和注册方法,详细提供官方账号快速访问方式、网页版操作教程及安全登录技巧,帮助用户轻松管理Gmail邮箱账户,实现高效、安全的邮箱使用体验。
25
2026.02.10
本专题全面汇总铁路12306订票、退票、改签及候补订单操作技巧,提供车厢座位分布参考、抢票攻略和高铁安检注意事项,帮助新手用户快速掌握高效购票与退改流程,提高出行效率和体验。
31
2026.02.10
本专题面向 AI 与数据科学开发者,系统讲解 TensorFlow 2 框架下深度学习模型的构建、训练、调优与部署。内容包括神经网络基础、卷积神经网络、循环神经网络、优化算法及模型性能提升技巧。通过实战项目演示,帮助开发者掌握从模型设计到上线的完整流程。
0
2026.02.10
本专题讲解 Vue 3 组合式 API 的核心概念与应用技巧,深入分析响应式系统、生命周期管理、组件设计与复用策略。通过完整项目案例,指导前端开发者实现高性能、结构清晰的 Vue 应用,提升开发效率与代码可维护性。
4
2026.02.10
本专题面向有 Go 基础的开发者,系统讲解微服务架构设计与 gRPC 的高效应用。内容涵盖服务拆分、RPC 通信、负载均衡、错误处理、服务注册与发现等关键技术。通过实战案例,帮助开发者搭建高性能、可扩展的 Go 微服务系统。
1
2026.02.10
本专题专注于 React 18 的高级开发技术,详细讲解 useState、useEffect、useReducer、useContext 等 Hooks 的使用技巧,以及 Redux、Zustand 等状态管理工具的集成与优化方法。通过真实案例,帮助前端开发者构建可维护、性能优良的现代 React 应用。
4
2026.02.10
本专题针对初中级 Node.js 开发者,系统讲解如何使用 Express 框架搭建高性能后端服务。内容包括路由设计、中间件开发、数据库集成、API 安全与异常处理,以及 RESTful API 的设计与优化。通过实际项目演示,帮助开发者快速掌握 Node.js 后端开发流程。
2
2026.02.10
热门下载
相关下载
精品课程
共6课时 | 0.3万人学习
共7课时 | 0.4万人学习
共2课时 | 0.1万人学习
