Asp jpeg watermark adding tutorial and thumbnail generation tutorial

Source: Internet
Author: User

1. Add a watermark to an image

Dim JPEG
Set JPEG = server. Createobject ("persits. jpeg") 'creates an object.
JPEG. Open blogpath & "/upload/" & filename 'image location
JPEG. Canvas. Font. Color = & h000000' color, which is set to: Black
JPEG. Canvas. Font. Family = "正" 'set the font
Whether to set jpeg. Canvas. Font. Bold = false' to bold
JPEG. Canvas. Font. size = 26' font size
JPEG. Canvas. Font. Quality = 4' text definition
JPEG. Canvas. Print jpeg. originalwidth/2-170, JPEG. OriginalHeight-30, "www. William Long. Info" 'watermark text
JPEG. Save blogpath & "/upload/" & filename 'Save the file
Set JPEG = nothing

2. Create a thumbnail for the image

Dim JPEG
Set JPEG = server. Createobject ("persits. jpeg") 'creates an object.
JPEG. Open blogpath & "/upload/" & filename 'image location
JPEG. width = jpeg. originalwidth/2
JPEG. Height = jpeg. originalheight/2
'Set the thumbnail size (here the ratio is set to 50%), you can also give him an accurate value, such as JPEG. width = 120
JPEG. Save blogpath & "/upload/" & filename 'Save the file
Set JPEG = nothing

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.