PHP中应用GD2函数在图像上添加文字

<?php
     header("Content-type:text/html;charset=utf-8");
     header("Content-type:image/gif");
     $im=imagecreatefromjpeg("images/qie.jpg");
     $textcolor=imagecolorallocate($im,56,73,136);
     $fnt="c:/windows/fonts/simhei.ttf";
     $text="南极企鹅";
     iconv("gb2312","utf-8",$text);
     imagettftext($im,20,0,10,80,$textcolor,$fnt,$text);
     imagegif($im);
     imagedestroy($im);
?>
时间: 2024-07-31 14:34:41

PHP中应用GD2函数在图像上添加文字的相关文章

【练习4.1】图像转换、Canny检测、图像合并、在图像上输出文字

2014-07-17 第四章 细说HighGUI 练习题第1题 题目大致要求: a:(1)从视频文件读入数据,(2)转换为灰度图,(3)做Canny边缘检测,显示在三个窗口 b:将a的三个视频显示在一个窗口中 c:在b步骤的不同部分写上合适的文字标签 代码: 1 #include "stdafx.h" 2 #include <windows.system.h> 3 #include <iostream> 4 #include <cv.h> 5 #in

Inno&nbsp;Setup技巧[界面]欢迎页面上添加文字

原文:Inno Setup技巧[界面]欢迎页面上添加文字 本文介绍在"欢迎页面添加文字"的两种方法. 界面预览: Setup技巧[界面]欢迎页面上添加文字" title="Inno Setup技巧[界面]欢迎页面上添加文字"> 首先可以在[Code]段添加以下代码: procedure InitializeWizard(); var LabelDate: Tlabel; begin WizardForm.WelcomeLabel2.Autosize

【Android】在图片上添加文字

[Android]在图片上添加文字 在Edittext中插入图片 下载地址:http://www.devstore.cn/code/info/604.html

python 图片上添加文字

1 import PIL 2 from PIL import ImageFont 3 from PIL import Image 4 from PIL import ImageDraw 5 6 #设置字体,如果没有,也可以不设置 7 font = ImageFont.truetype("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf",13) 8 9 #打开底版图片 10 imageFile = "base.png&qu

opencv在图片上添加文字

/****************************************** func:cvText desc:put text on an image @param img The image pointer which we want to put text on @param text the text pointer @param x the x coordinate @param y the y coordinate @return null ****************

python PIL(pillow)图像处理-图片上添加文字

from PIL import Image, ImageDraw, ImageFont def gen_img(size=None): if size is None: size = 400 #生成大小为400x400RGBA是四通道图像,RGB表示R,G,B三通道,A表示Alpha的色彩空間 image = Image.new(mode='RGBA', size=(400, 400), color=(255, 55, 55)) # ImageDraw.Draw 简单平面绘图 draw_tabl

OpenCV实现图像上添加汉字 转

<span style="font-size:18px;">void GetStringSize(HDC hDC, const char* str, int* w, int* h) { SIZE size; GetTextExtentPoint32A(hDC, str, strlen(str), &size); if(w != 0) *w = size.cx; if(h != 0) *h = size.cy; } void paDrawString(Mat&

实时刷新winform中的某一个控件上的文字

需要注意的是,必须从UI线程,另外启动一个线程才可以. 在新线程调用异步刷新就OK了 Thread thread; private void button1_Click(object sender, EventArgs e) { thread = new Thread(new ThreadStart(AnotherRefresh)); thread.IsBackground = true; thread.Start(); } private void AnotherRefresh() { MyR

在图像上增加文字 C#

using (Image i = Image.FromFile(inputPath)) { using (Graphics g = Graphics.FromImage(i)) { g.DrawString("John", Font, Brushes.Black, new PointF(fX, fY1)); g.DrawString("2018-10-01", Font, Brushes.Black, new PointF(fX, fY2)); } i.Save(o