Senior
Test in ASP
<%
' Generate abbreviations
On Error Resume Next
Set Obj=server. CreateObject ("Flysoft.image")
Obj. Loadfromfile=server. MapPath ("./love.bmp") ' original picture
Obj. Rate = 0.5 ' scaling ratio where <1 is reduced, >1 is magnified
Obj. Outputimgfile server. MapPath ("./lovethumbmail_bmp.jpg") ' Generate results picture
If Err.number<>0 Then
Response.Write Err.Description
End If
%>
' Generate watermarks
<%
' Generate a text watermark
On Error Resume Next
Set Obj=server. CreateObject ("Flysoft.image")
Obj. Rate = 0.5 ' scaling ratio where <1 is reduced, >1 is magnified
Obj. Markrotate = 25 ' rotation angle
Obj. Masktext = "Romantic Valentine's Day I wish the world will be married" "' to show the text
Obj. Masktextfontname = "Chinese cloud" ' font settings
Obj. LoadFromFile =server. MapPath ("./rose.bmp") ' original picture
Obj. Outputtxtimgfile server. MapPath ("./rose_txtimg.jpg"), Vbblack, 20, 50, 0, 400 ' parameters represent: generated picture, font color, font width, font height, last two parameters refers to the position of the text relative to the upper-left corner of the original picture
If Err.number<>0 Then
Response.Write Err.Description
End If
%>
<%
' Generate a picture watermark
On Error Resume Next
Set Obj=server. CreateObject ("Flysoft.image")
Obj. Rate = 0.5 ' scaling ratio where <1 is reduced, >1 is magnified
Obj. LoadFromFile = Server. MapPath ("./love. JPG ") ' original picture
Obj. Loadfrommaskimgfile = Server. MapPath ("./rose_mark.bmp") ' Watermark picture
Obj. Outputmarkimgfile server. MapPath ("./lovemark.jpg"), 350, 350, 100 ' Generate results picture 500,500 for watermark picture relative to the original picture in the upper-left corner of the coordinate position the last 100 is transparency (0 most transparent, 100 opaque)
If Err.number<>0 Then
Response.Write Err.Description
End If
%>
The performance test was also done
The author's machine configuration is Celeron 850, memory 512 machine generated 50 pictures (thumbnail, text watermark, image watermark) used for 7 seconds
machine configuration is P4 2.4, memory 1G Machine generated 50 pictures (thumbnail, text watermark, image watermark) in 2 seconds