ASP components advanced Introduction and Mastery Series III

Source: Internet
Author: User

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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.