在CF8中,我有一个生成captcha的32位编译器。在我切换到64位系统之前,这是非常有效的。DLL有500个错误,所以我安装了cfx_openimage。现在起作用了。然而,第4和第5位中的许多字母/数字都被缩小了,以至于你甚至连它都看不懂。它只需要显示预先制作的gif,它是从一个名为P_codes的文件夹中提取的,但是不需要缩放特定的字母.就像-现在一样。我似乎不能让这件事起作用。
下面是调用图像的代码。有什么主意吗?
<CFSET var.codenum = RandRange(60466176, 2147483647)>
<CFSET var.passcode = ucase(replace(replace(toString(formatBaseN(var.codenum, 36)),"0","P","ALL"),"o","J","ALL"))>
<CFSET imgName = createUUID()&'.gif'>
<CFSET line1 = "0,#randRange(0,30)#,140,#randRange(0,35)#">
<CFSET line2 = "0,#randRange(0,40)#,140,#randRange(0,40)#">
<CFSET line3 = "0,#randRange(5,45)#,140,#randRange(10,45)#">
<CFSET line4 = "0,#randRange(10,50)#,140,#randRange(20,50)#">
<CFSET line5 = "0,#randRange(20,50)#,140,#randRange(20,50)#">
<CFSET pos1 = randRange(1,24)>
<CFSET pos2 = randRange(1,24)>
<CFSET pos3 = randRange(1,24)>
<CFSET pos4 = randRange(1,24)>
<CFSET pos5 = randRange(1,24)>
<CFSET pos6 = randRange(1,24)>
<CFSET bgcolor = "#formatBaseN(randRange(80,210),16)##formatBaseN(randRange(80,210),16)##formatBaseN(randRange(80,210),16)#">
<CFX_IMAGE ACTION="IML"
FILE="NEW"
X="140"
Y="50"
BGCOLOR="#bgcolor#"
COMMANDS="
setfontantialias
setfont 19,0,0,bold,Verdana
##setbrushsize 200
line #line1#,000000
line #line2#,000000
line #line3#,000000
line #line4#,000000
line #line5#,000000
text 0,#pos1#,20,50,000000,#mid(var.passcode,1,1)#
text 25,#pos2#,40,50,000000,#mid(var.passcode,2,1)#
text 49,#pos3#,60,50,000000,#mid(var.passcode,3,1)#
text 73,#pos4#,80,50,000000,#mid(var.passcode,4,1)#
text 97,#pos5#,100,50,000000,#mid(var.passcode,5,1)#
text 121,#pos6#,120,50,000000,#mid(var.passcode,6,1)#
write #expandPath('./_pcodes/')##imgName#
">
<!--- <cfoutput><img src="#imgname#"></cfoutput> --->
<!--- <cfcontent type="image/gif" file="#expandPath('./')##imgName#" deletefile="Yes"> --->发布于 2014-08-12 17:40:20
#pos1#,20,50,000000,#mid(var.passcode,1,1)# text 25,#pos2#,40,50,000000,#mid(var.passcode,2,1)# text 49,#pos3#,60,50,000000,#mid(var.passcode,3,1)# text 73,#pos4#,80,50,000000,#mid(var.passcode,4,1)#
请参阅上面的代码,代码的6行以"text“开头,后面跟着数字20、40、60、80和120?这决定了字体的大小。只要把这些数字加起来,瞧,‘:-)
https://stackoverflow.com/questions/25165639
复制相似问题