<%
Call CreateView ("UploadFile/f.jpg", "1 ")
'Createview (source image path, text/image watermark)
'----------------------------------
'Create preview image and watermark: call CreateView (file path, watermark image file to be added)
'Design by Seven (See7di@Gmail.com) (www.7di.net)
Sub CreateView (imagename, inttype)
Dim Object, objFont, img, Obj, LogoPath, sWidth, sHeight
Img = "/a.jpg" '// LOGO File
SWidth = "147" '// LOGO width
SHeight = "52" '// LOGO height
LogoPath = Server. MapPath (img) '// LOGO path
Set Obj = Server. CreateObject ("Persits. Jpeg") '// create a LOGO object
Set Object = Server. CreateObject ("Persits. Jpeg") '// create the source image Object
On Error resume Next
Obj. Open LogoPath '// read the LOGO
If err> 0 Then
Response. Write ("sorry, failed to get the LOGO image file! ")
Response. End ()
End if
Object. Open Trim (Server. MapPath (imagename) '// read the source Image
If err> 0 Then
Response. Write ("sorry, failed to get the image file to be processed! ")
Response. End ()
End if
Obj. Width = sWidth '// Add the original image Width
Obj. Height = sHeight '// Add the original image Height
'\ If the source image is larger than the LOGO
If Object. width> Cint (Obj. Width) and Object. Height> Cint (Obj. Height) Then
StrDo = "yes"
End if
If inttype = 1 Then
Object. Canvas. Font. Color = & HFF0000 '// text Color
Object. Canvas. Font. Family = "Verdana" '// text Font
Object. Canvas. Font. Bold = true' // whether to Bold
Object. Canvas. Print 10, 10, "www.Sditi.com" '// Print the coordinates x Print the characters that y needs to Print
Object. Canvas. Pen. Color = & h000000' // background Color
Object. Canvas. Pen. Width = 1' // paint Width
Object. Canvas. Brush. Solid = false' // whether to perform rough Processing
Object. Canvas. Bar 0, 0, Object. Width, Object. Height '// start X coordinate start Y coordinate input length input Height
Else
If strDo = "yes" Then
Object. Canvas. Pen. Color = & hffffff' // border Color
Object. Canvas. Pen. Width = 0' // Border Width
Object. Canvas. Brush. Solid = false' // specifies whether the color is filled in the border of the image.
Object. DrawImage Object. Width/2, Object. Height/2, Obj, 0.7, & HFFFFFF, 90' // Add the position, coordinates, and transparency of the image (add a watermark image)
Object. Canvas. Bar 0, 0, Object. Width, Object. height' // coordinates of the position of the border line of the image
Object. Width = Object. Width
Object. height = Object. height
Object. Sharpen 1,120
End if
End If
Object. Save Server. MapPath (imagename) '// generate a file
Set Obj = Nothing
End Sub
%>