Function JPG_DrawEllipseAndStrin(filename,str,leftlen,toplen,rightlen,bottomlen)
2u0npb&vr7KW&\&S*P0'******************************
4K3c.OXLd)`
G)t0' Description: Add note to a picture at specific area
51Testing软件测试网t9p`wOS.al%~' Precondition: Install tool aspjpeg
-J O+KCK@8Xm0' Input: filename---Picture path
^6E!Y2f;n:Ti0' str--------String to write
51Testing软件测试网:F3i6PEa3Uw' leftlen----left lenth to original point
51Testing软件测试网4[9n#}rO(X[' toplen-----top lenth to original point
O1`!V+JT!nb0' rightlen---right lenth to original point
4{i(Q!ct?r0' bottomlen-bottom lenth to original point
$kJZr+O.aUn8J.v x0' Output: None
IA ss&U.}]$\Ai0' Example: JPG_DrawEllipseAndString("C:\org.jpg","LantianWei",100,200,500,400)
?x3B3K,C0' Tester: LantianWei(
wan1314sq@126.com)
51Testing软件测试网6w;B9y*iWcp*{k*L(SQ' Date: Dec 23, 2007
51Testing软件测试网)c v5\H+}2^R'******************************
51Testing软件测试网0V*k/M IY^ Dim Jpeg,tmpleft,tmptop,tmpright,tmpbottom
yDW*[+WG!m0 Set Jpeg=CreateObject("Persits.Jpeg")
51Testing软件测试网5E,]6a})u7Ugy|^ Jpeg.Open filename
l:GBjrG0 Jpeg.Canvas.Pen.Color=vbRed
:y"yt+W_m0 Jpeg.Canvas.Pen.Width=2
51Testing软件测试网BG7T*{z
y*{ Jpeg.Canvas.Brush.Solid=False '是否加粗
51Testing软件测试网~#tBUH9V{ Jpeg.Canvas.Ellipse leftlen,toplen,rightlen,bottomlen '画椭圆
'lH8F#t(cYM;Rk0 ;JB;Ym(ly!Hn0 If leftlen>Jpeg.OriginalWidth/2 Then
Xi{3f"e$r2Az0 tmpleft=leftlen
(Vyi1i3runX D0 tmptop=toplen+(bottomlen-toplen)/2
$C4SE#n-I1@(ylHF0 If toplen+(bottomlen-toplen)/2>Jpeg.OriginalHeight/2 Then
z h1S-Lt
O l|0 tmpright=leftlen-100
`1y5A`DR5u0 tmpbottom=toplen+(bottomlen-toplen)/2-100
51Testing软件测试网6f*blfP/{ Else
G(QB"Be%`f7lJ0 tmpright=leftlen-100
u G*~/@x7\/o
l0 tmpbottom=toplen+(bottomlen-toplen)/2+100
51Testing软件测试网 ^3C F#f0S#v%A$MC End If
51Testing软件测试网$ZpK7d%WU;r
V6w"h Else
2w$Z^Bwj0 tmpleft=rightlen
51Testing软件测试网.Hxv,g,S7r4Q
L$S tmptop=toplen+(bottomlen-toplen)/2
:s tW5f_f2r0 If toplen+(bottomlen-toplen)/2>Jpeg.OriginalHeight/2 Then
51Testing软件测试网bYJbg tmpright=rightlen+100
i:|Ho1F)}sn0 tmpbottom=toplen+(bottomlen-toplen)/2-100
51Testing软件测试网.\L.vXq"J#j Else
51Testing软件测试网G#Nb6w|q%|)b O
| tmpright=rightlen+100
51Testing软件测试网V"b[%|r7w%Ow$D tmpbottom=toplen+(bottomlen-toplen)/2+100
51Testing软件测试网3~;`}y1~GZ@ End If
b(dI6Bga0 End If
K2fp;[Oc]0 51Testing软件测试网GTj,F ibX Jpeg.Canvas.DrawLine tmpleft,tmptop,tmpright,tmpbottom
"xa?-x
ntw0 Jpeg.Canvas.Font.Color=vbRed '红颜色
51Testing软件测试网Kw1e}&_ f{ Jpeg.Canvas.Font.Bold=True '是否加粗
51Testing软件测试网+p5ia#FwZ4I!H'ys Jpeg.Canvas.Print tmpright,tmpbottom,str
51Testing软件测试网
Q:X
V'T;fRaQ[ P Jpeg.Canvas.DrawBar 0,0,Jpeg.OriginalWidth,Jpeg.OriginalHeight
51Testing软件测试网U!g{s { Jpeg.Save filename
JReV+ES"_0 Jpeg.Close
J.vd};J0 Set Jpeg=Nothing
51Testing软件测试网oiM A|U%L]@End Function