Picture watermark
' Intdirection: Picture location:
' If the array (left,top) is passed in:
' Left ' indicates the X-directional distance of the watermark picture relative to the upper-right corner of the source graph
' Top indicates the distance from the upper-left Y-direction of the watermark picture relative to the source graph
' If it is a single digit:
' 1: Upper left 2: Upper 3: Top 4: Left Middle 5: Middle 6: Right Middle 7: Left Lower 8: Lower 9, lower right
' strFileName: The filename used as a watermark picture
Public Sub DrawImage (intdirection,strfilename)
Dim objjpeg2
Dim intwidth
Dim intheight
Dim intleft
Dim inttop
Message = ""
If Fileisopen Then
If Objfso.fileexists (Server.MapPath (strFileName)) Then
On Error Resume Next
Set objjpeg2 = Server.CreateObject ("Persits.jpeg")
With OBJJPEG2
. Open Server.MapPath (strFileName)
If Err Then
message = Err.Description
End If
If Intjpegwidth = 0 or intjpegheight = 0 Then
Intwidth =. OriginalWidth
Intheight =. OriginalHeight
Else
Intwidth = Intjpegwidth
Intheight = Intjpegheight
End If
If Intwidth<width and IntheightIf not IsArray (intdirection) Then
Select Case Intdirection
Case 1
Intleft = 0
Inttop = 0
Case 2
Intleft = (width-intwidth)/2
Inttop = 0
Case 3
Intleft = Width-intwidth
Inttop = 0
Case 4
Intleft = 0
Inttop = (height-intheight)/2
Case 5
Intleft = (width-intwidth)/2
Inttop = (height-intheight)/2
Case 6
Intleft = Width-intwidth
Inttop = (height-intheight)/2
Case 7
Intleft = 0
Inttop = Height-intheight
Case 8
Intleft = (width-intwidth)/2
Inttop = Height-intheight
Case Else
Intleft = Width-intwidth
Inttop = Height-intheight
End Select
Else
Intleft = intdirection (0)
Inttop = intdirection (1)
End If
On Error Resume Next
Objjpeg.drawimage Intleft,inttop,objjpeg2,floatjpegopacity,intjpegcolor
If Err Then
Message = "There is an error in playing a picture Watermark!" "
End If
Else
message = "watermark picture pixel too large!" "
End If
End With
Else
message = "Watermark picture does not exist!" "
End If
Else
Message = "File not open!" "
End If
End Sub
%>