Use the aspjpeg component to Create Image thumbnails and watermarks

Source: Internet
Author: User
Aspjpeg is a shared software developed by persits. The trial period is 30 days. You can download it at http://www.persits.com/asp;.exe. The latest version is 1.3.
Aspjpeg is a powerful image processing component that allows you to easily create thumbnails and add watermarks to images. The following describes how to use it:
You must first install the downloaded EXE file.
1. Create a thumbnail for the image

Code: [copy to clipboard] <% 'create an instance
Dim JPEG, path
Set JPEG = server. Createobject ("persits. jpeg ")
'Image location
Path = server. mappath ("Images") & "\ clock.jpg"

'Open
JPEG. Open Path

'Set the thumbnail size (the proportion is set to 50% here)
JPEG. width = jpeg. originalwidth/2
JPEG. Height = jpeg. originalheight/2

'Save the thumbnail to the specified folder.
JPEG. Save server. mappath ("Images") & "\ clock_small.jpg"

'Deregistering an instance
Set JPEG = nothing
%>

<p>

2. Add a watermark to an image

Code: [copy to clipboard] <%
Dim JPEG
'Create an instance
Set JPEG = server. Createobject ("persits. jpeg ")
'Open the Target Image
JPEG. Open Server. mappath ("images/dodge_viper.jpg ")

'Add a text watermark
JPEG. Canvas. Font. Color = & hff0000 'red
JPEG. Canvas. Font. Family = ""
JPEG. Canvas. Font. Bold = true
JPEG. Canvas. Print 10, 10, "Copyright (c) cnmaya.org"

'Save the file
JPEG. Save server. mappath ("images/dodge_viper_framed.jpg ")

'Logout object
Set JPEG = nothing
%>

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.