The function of ASP picture plus watermark

Source: Internet
Author: User
Tags save file

The ASP is definitely a component that needs to be implemented. Found a aspjpeg component, the realization of the image watermark or text watermark function, the use of the component name is: AspJpeg 1.9.0.1 (search V1.9 should be found) crack registration code: 17361-38566-42221 (Input when the installation is complete)


‘The parameters passed in are the path of the image to be processed, and you can adjust the parameters or add other parameters as needed.
‘Text watermark
FunctionWordwatermark (ImagePath)
DimImage
SetImage=Server.CreateObject ("Persits.jpeg")‘Build objects
Image.open Server.MapPath (ImagePath)‘Where the picture is located
Image.Canvas.Font.Color=&H000000‘Color, here is set to: Black
Image.Canvas.Font.Family="Song Body"‘Set font
Image.Canvas.Font.Bold=False‘is set to Bold
Image.Canvas.Font.Size=26 ‘Font size
Image.Canvas.Font.Quality=4‘Text clarity
Image.Canvas.Print Image.originalwidth/2-170, Image.originalheight-30,"Watermark Text"‘Watermark Text
Image.Save Server.MapPath (ImagePath)‘Save File
SetImage=Nothing
End Function

‘Image watermark
FunctionImagewatermark (ImagePath)
SetImage=Server.CreateObject ("Persits.jpeg")
‘Determine the path to the image to add the watermark to
Photopath=Server.MapPath (ImagePath)
Image.open Photopath
‘Open watermark Picture
SetLogo=Server.CreateObject ("Persits.jpeg")
Logopath=Server.MapPath ("logo.jpg")‘Picture of the Watermark
Logo.open Logopath
Logo.width=121‘The size of the watermark picture
Logo.height=50
Transition_color=&h0066cc
‘Place the watermark in the upload image
Image.drawimage Image.width-150, Image.height-59, Logo,1, Transition_color,90
' Here you can change where the watermark is located (photo.width-210,photo.height-40 here I put it in the bottom right corner of the picture) also can change the transparency of the watermark
' Save the image after adding the watermark
Image.Save Server.MapPath (ImagePath)

Set Photo = Nothing
End Function

The function of ASP picture plus watermark

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.