导航:首页 > 文字图片 > 文字生成图片代码

文字生成图片代码

发布时间:2022-04-27 02:37:32

㈠ 讨论在PHP中如何把带有HTML内容的文字生成图片

具体代码如下:
<?php
$ch = curl_init();
$timeout = 5;
curl_setopt ($ch, CURLOPT_URL, '');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
echo $file_contents;
?>
​PHP 独特的语法混合了C、Java、Perl以及PHP自创的语法。
它可以比CGI或者Perl更快速地执行动态网页。用PHP做出的动态页面与其他的编程语言相比,PHP是将程序嵌入到HTML(标准通用标记语言下的一个应用)文档中去执行,
执行效率比完全生成HTML标记的CGI要高许多;
PHP还可以执行编译后代码,编译可以达到加密和优化代码运行,使代码运行更快。

㈡ php文字生成图片

如果是生成的图片是乱码文字,那么就是ttf字体库不对

㈢ PHP怎么把文字生成图片啊

中文只要注意字体和utf-8就行了...顺便说句,debian安全列表今天有个freetype的安全警告,注意升级...

㈣ 如何把文字弄成图片

1、打开word文档,选定需要将其变成图片的文字,将其复制到粘贴板上。


㈤ 怎样把文字做成图片

只要将VB窗口内的需要部分保存成图片文件就可以了
要用到API函数的:
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long

Private Sub Command1_Click()
Dim hdc As Long
Dim sw As Integer
Dim sh As Integer
Dim CurPos As POINTAPI
Dim Cur As Long
Me.Hide
DoEvents
Picture1.AutoRedraw = True
hdc = GetDC(0)
GetCursorPos CurPos
Cur = GetCursor
Picture1.Width = Screen.Width
Picture1.Height = Screen.Height
sw = Screen.Width / Screen.TwipsPerPixelX
sh = Screen.Height / Screen.TwipsPerPixelY
BitBlt Picture1.hdc, 0, 0, sw, sh, hdc, 0, 0, vbSrcCopy
Me.Show
DrawIcon Picture1.hdc, CurPos.x - 10, CurPos.y - 10, Cur
ReleaseDC 0, hdc
Picture1.AutoRedraw = False

以下放到模块里:
Option Explicit

Type RECT_Type

left As Long
top As Long
right As Long
bottom As Long

End Type

'The following declare statements are case sensitive.

Declare Function GetActiveWindow Lib "User32" () As Long
Declare Function GetDesktopWindow Lib "User32" () As Long
Declare Sub GetWindowRect Lib "User32" (ByVal Hwnd As Long, _
lpRect As RECT_Type)
Declare Function GetDC Lib "User32" (ByVal Hwnd As Long) As Long
Declare Function CreateCompatibleDC Lib "Gdi32" (ByVal hdc As Long) _
As Long
Declare Function CreateCompatibleBitmap Lib "Gdi32" (ByVal hdc _
As Long, ByVal nWidth As Long, _
ByVal nHeight As Long) As Long
Declare Function SelectObject Lib "Gdi32" (ByVal hdc As Long, _
ByVal hObject As Long) As Long
Declare Function BitBlt Lib "Gdi32" (ByVal hDestDC As Long, _
ByVal X As Long, ByVal Y _
As Long, ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal hSrcDC As Long, _
ByVal XSrc As Long, _
ByVal YSrc As Long, _
ByVal dwRop As Long) As Long
Declare Function OpenClipboard Lib "User32" (ByVal Hwnd As Long) As Long
Declare Function EmptyClipboard Lib "User32" () As Long
Declare Function SetClipboardData Lib "User32" (ByVal wFormat As Long, _
ByVal hMem As Long) As Long
Declare Function CloseClipboard Lib "User32" () As Long
Declare Function ReleaseDC Lib "User32" (ByVal Hwnd As Long, _
ByVal hdc As Long) As Long
Declare Function DeleteDC Lib "Gdi32" (ByVal hdc As Long) As Long
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Global Const SRCCOPY = &HCC0020
Global Const CF_BITMAP = 2

Function ScreenDump()
Dim AccessHwnd As Long, DeskHwnd As Long
Dim hdc As Long
Dim hdcMem As Long
Dim rect As RECT_Type
Dim junk As Long
Dim fwidth As Long, fheight As Long
Dim hBitmap As Long

' DoCmd.Hourglass True

'---------------------------------------------------
' Get window handle to Windows and Microsoft Access
'---------------------------------------------------
DoEvents
DeskHwnd = GetDesktopWindow()
AccessHwnd = GetActiveWindow()

'---------------------------------------------------
' Get screen coordinates of Microsoft Access
'---------------------------------------------------
Call GetWindowRect(AccessHwnd, rect)
fwidth = rect.right - rect.left
fheight = rect.bottom - rect.top

'---------------------------------------------------
' Get the device context of Desktop and allocate memory
'---------------------------------------------------
hdc = GetDC(DeskHwnd)
hdcMem = CreateCompatibleDC(hdc)
hBitmap = CreateCompatibleBitmap(hdc, fwidth, fheight)

If hBitmap <> 0 Then
junk = SelectObject(hdcMem, hBitmap)

'---------------------------------------------
' Copy the Desktop bitmap to memory location
' based on Microsoft Access coordinates.
'---------------------------------------------
junk = BitBlt(hdcMem, 0, 0, fwidth, fheight, hdc, rect.left, _
rect.top, SRCCOPY)

'---------------------------------------------
' Set up the Clipboard and bitmap
'---------------------------------------------
junk = OpenClipboard(DeskHwnd)
junk = EmptyClipboard()
junk = SetClipboardData(CF_BITMAP, hBitmap)
junk = CloseClipboard()
End If

'---------------------------------------------
' Clean up handles
'---------------------------------------------
junk = DeleteDC(hdcMem)
junk = ReleaseDC(DeskHwnd, hdc)

' DoCmd.Hourglass False

End Function

这里是拖动鼠标的框里内容截取,你也可以改成固定范围的截取。

1回答者: redfoxgc - 试用期 二级 2009-9-4 19:14

我来评论>> 相关内容
• VB 如何将窗体生成JPG图片 2006-12-22
• 请问在VB中要添加一张图片,如何使它充满整个窗体? 2008-6-5
• vb中窗体中的图片如何设置可以使其覆盖整个窗体 2006-11-1
• VB中form窗体的背景图片如何调整属性使背景图片的大小和窗体大小一样 2008-12-17
• 各位大虾:我遇到一个问题,在vb的多文档窗口中添加背景图片后,这个图片如何才能使其与窗体一起放大缩小 2007-1-31
更多相关问题>>
查看同主题问题: 生成 图片 窗体
其他回答 共 8 条
不知道你所谓的清晰是达到什么样的程度..
假如你的学生数据是整理好的,这个东西倒不难做

回答者: fender_x - 中级经理 八级 2009-9-4 19:06

呵呵,这个项目不错。我可以试试。。

回答者: 房恩宏 - 军侯 八级 2009-9-4 19:06

天亿截图圣手软件

回答者: ljx_1399 - 试用期 二级 2009-9-4 19:30

下面分二步介绍如何把VB得部分窗体生成图片(清晰的)

一、建立一个模块,复制下面代码:

'=============模块开始=================
Option Explicit

Private Type PALETTEENTRY
peRed As Byte
peGreen As Byte
peBlue As Byte
peFlags As Byte
End Type

Private Type LOGPALETTE
palVersion As Integer
palNumEntries As Integer
palPalEntry(255) As PALETTEENTRY
End Type

Private Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(7) As Byte
End Type

Private Const RASTERCAPS As Long = 38
Private Const RC_PALETTE As Long = &H100
Private Const SIZEPALETTE As Long = 104

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private Declare Function CreateCompatibleDC Lib "GDI32" (ByVal hDC As Long) As Long

㈥ 求一段php文字生成图片的代码

把imageString()去掉,加上下面的代码试试,很多人用这做图片水印的-_-!
$font_file = "字体文件的路径";
$str = '我爱PHP!';
$str = mb_convert_encoding($str,"UTF-8","GBK");
imagettftext('图像','字体大小','角度',x,y,'颜色',$font_file,$str);

㈦ PHP文字生成图片

imagettftext($im,26,0,0,40,$black,“C:\windows\Fonts\FZDHTJW.ttf”,$ment); //字体路径
header(“Content-type:image/png”);
这里面的引号是中文引号,换成英文下的引号

㈧ HTML5中用JS在画布中将文字转化为图片代码,望解释清楚些,谢谢

使用JavaScript将图片拷贝进画布
要想将图片放入画布里,我们使用canvas元素的drawImage方法:
// Converts image to canvas; returns new canvas element
function convertImageToCanvas(image) {
var canvas = document.createElement("canvas");
canvas.width = image.width;
canvas.height = image.height;
canvas.getContext("2d").drawImage(image, 0, 0);

return canvas;
}

这里的0, 0参数画布上的坐标点,图片将会拷贝到这个地方。
用JavaScript将画布保持成图片格式
如果你的画布上的作品已经完成,你可以用下面简单的方法将canvas数据转换成图片格式:
// Converts canvas to an image
function convertCanvasToImage(canvas) {
var image = new Image();
image.src = canvas.toDataURL("image/png");
return image;
}

这段代码就能神奇的将canvas转变成PNG格式!
这些在图片和画布之间转换的技术可能比你想象的要简单的多。在以后的文章里,我会写一些将这些图片做不同滤镜处理的技术。

望采纳!!!!

㈨ 如何用C语言在已有的bmp图片上添加文字生成新的图片

把要添加的地方的像素换成文字,即是把原来的地方的像素点成文字的像素,然后重新保存。如果知道,原图片的bmp以及文字的bmp图片,和在添加的地方坐标,就可以完成了。
Windows下的简单绘图肯定会首先考虑GDI或者GDI+,不过既然LZ都提到Linux了,那就发个平台无关的生成BMP正弦图的代码好了,这个就是最原始的手动生成BMP的代码,其实也不是很复杂。

㈩ 前端技术 文字生成图片

<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<STYLE>
v\:* { BEHAVIOR: url(#default#VML) }
</STYLE>

<BODY>
<v:Rect style="position:relative;width:400px;height:400px">
<v:fill on="True" color="red"/>
<v:path textpathok="True"/>
<v:textpath on="True" string="VML Text"
style="v-rotate-letters:True;font:normal normal normal 36pt Arial"/>
</v:Rect>
</BODY>
</HTML>

阅读全文

与文字生成图片代码相关的资料

热点内容
老北京网鞋价格及图片 浏览:213
动漫战友图片 浏览:891
儿童连心发型图片 浏览:19
男生图片帅气高清头像图片 浏览:509
暖心的图片唯美的女孩图片 浏览:136
美女的小便真图片大全 浏览:182
如何制作图片电子书 浏览:635
手工水果摆盘简单图片 浏览:169
打印图片怎么居中 浏览:648
碎花点可爱图片壁纸 浏览:788
中国红包文字图片大全 浏览:875
如何能看图片上模糊的字 浏览:160
男生qq拍照图片 浏览:640
李晓璐发型图片 浏览:148
女孩闺蜜头像图片 浏览:989
可爱小斗图图片 浏览:505
用ps怎么裁剪图片 浏览:53
小林变成男生的图片 浏览:508
男生女生头部的简笔画图片 浏览:715
头像孩子图片大全可爱 浏览:272