function to write the image watermark effect function, the code is as follows:
Sub Jpegclass (imgurl,fontsize,family,isbold,top,left,content) ' Invoke procedure name
Dim jpeg,font_color,font_size,font_family,f_width,f_height,f_content
' Establish an instance
Set Jpeg = Server.CreateObject ("Persits.jpeg")
font_size=10
Font_family= "Song Body"
F_left= 5
F_top=5
If imgurl<> "" Then
Jpeg.open Server.MapPath (imgurl) ' Picture path and open it
Else
Response.Write "Picture Path not Found"
Exit Sub
End If
If fontsize<> "then font_size=fontsize" Font size
If family<> "then font_family=family" font
If top<> "" then f_left=left Watermark to the left of the picture
If left<> "" then F_top=top "watermark from top position of picture
If content= "then" watermark content
Response.Write "Watermark What content, Watermark is unsuccessful!" "
Exit Sub
Else
F_content=content
End If
' Add text watermark
Jpeg.Canvas.Font.Color = &hff0000 ' Red
Jpeg.Canvas.Font.Family = font_family
Jpeg.canvas.font.size= font_size
If Isbold=1 Then
Jpeg.Canvas.Font.Bold = True
End If
Jpeg.Canvas.Print F_left, F_top, f_content
' Save file
Jpeg.save Server.MapPath (Imgurl)
' Logout Object
Set Jpeg = Nothing
Response.Write "Watermark was successful, the picture added" &content& "
End Sub
Calls are as follows: Call Jpegclass ("Psg.jpg", 13, "italics", 1,18,18, "Hello, this is the Watermark program")
can easily realize the image watermark effect, of course your server must support ASPJPEG components!
Sub Jpegclass (imgurl,fontsize,family,isbold,top,left,content) ' Invoke procedure name
Dim jpeg,font_color,font_size,font_family,f_width,f_height,f_content
' Establish an instance
Set Jpeg = Server.CreateObject ("Persits.jpeg")
font_size=10
Font_family= "Song Body"
F_left= 5
F_top=5
If imgurl<> "" Then
Jpeg.open Server.MapPath (imgurl) ' Picture path and open it
Else
Response.Write "Picture Path not Found"
Exit Sub
End If
If fontsize<> "then font_size=fontsize" Font size
If family<> "then font_family=family" font
If top<> "" then f_left=left Watermark to the left of the picture
If left<> "" then F_top=top "watermark from top position of picture
If content= "then" watermark content
Response.Write "Watermark What content, Watermark is unsuccessful!" "
Exit Sub
Else
F_content=content
End If
' Add text watermark
Jpeg.Canvas.Font.Color = &hff0000 ' Red
Jpeg.Canvas.Font.Family = font_family
Jpeg.canvas.font.size= font_size
If Isbold=1 Then
Jpeg.Canvas.Font.Bold = True
End If
Jpeg.Canvas.Print F_left, F_top, f_content
' Save file
Jpeg.save Server.MapPath (Imgurl)
' Logout Object
Set Jpeg = Nothing
Response.Write "Watermark was successful, the picture added" &content& "
End Sub
Calls are as follows: Call Jpegclass ("Psg.jpg", 13, "italics", 1,18,18, "Hello, this is the Watermark program")
can easily realize the image watermark effect, of course your server must support ASPJPEG components!