1. Add watermark to the picture
The code copy is as follows:
<%
Dim Jpeg ”//Declare variables
Set Jpeg = Server.CreateObject("Persits.Jpeg") ""//Calling component
Jpeg.Open Server.MapPath("aaa.JPG") ”// Source image location
Jpeg.Canvas.Font.Color = &H000000 ”//Watermark font color
Jpeg.Canvas.Font.Family = "Songzi" ""//Watermark font
Jpeg.Canvas.Font.Size = 14 ”//Watermark font size
Jpeg.Canvas.Font.Bold = False ”//Is it bold? Use: True
Jpeg.Canvas.Font.BkMode = &HFFFFF ”//Font background color
Jpeg.Canvas.Print 10, 10, “Undefeated Naughty Studio””//Watermark text, two numbers 10 are the xy coordinates of the watermark
Jpeg.Save Server.MapPath("aaa_05.jpg") ”// Generate a new image with a watermark and save location
Set Jpeg = Nothing ”//Login the component and release the resource
Response.Write "<img src=aaa_05.jpg>" ""//Show the image after the watermark is generated on this page
%>
2. Generate thumbnails
The code copy is as follows:
<%
Dim Jpeg ”//Declare variables
Set Jpeg = Server.CreateObject("Persits.Jpeg") ""//Calling component
Jpeg.Open Server.MapPath("aaa.JPG") ”//Original image location
Jpeg.Width = Jpeg.OriginalWidth/4 ”//Suppose the width of the picture is one quarter of the original picture
Jpeg.Height = Jpeg.OriginalHeight/4 ”//Suppose the height of the picture is one quarter of the original picture
Jpeg.Sharpen 1, 130 ”//Set the sharpening effect
Jpeg.Save Server.MapPath("aaa_small.jpg") ”// Generate thumbnail location and name
Set Jpeg = Nothing ”//Login the component and release the resource
Response.Write "<img src=aaa_small.jpg>" ""//Show the generated thumbnail image on this page
%>
[code]
Introduction to advanced usage methods of aspjpeg components
aspjpeg is a very powerful image processing component, in pure English version. However, there have been free versions and cracked versions, but there are not many articles that provide detailed and in-depth introductions to them. Even if there are, they only involve picture thumbnails and picture watermarks. Maybe it's because of pure English.
Here I will talk about the advanced usage of aspjpeg for these issues. The technologies here mainly include:
Picture thumbnail
Picture watermark
Security code technology
Picture cutting
Picture merge
Database support
More infrequently used methods
and some related practical technologies
The only shortcoming point of aspjpeg is that the output method is relatively single. Here, we mainly talk about this output method that saves the image and then calls it. In addition, I am relatively lazy, so some codes are still quoted in the original document, and I will explain what I don’t understand!
Comrades who have studied vb or .net will definitely understand it at a glance. The brush comes. hehe.
1. Picture thumbnail
[code]
<%
Set Jpeg = Server.CreateObject("Persits.Jpeg") Calling component
Path = Server.MapPath("images") & "/clock.jpg" pending image path
Jpeg.Open Path Open picture
Height and width are 1/2 of the original picture
Jpeg.Width = Jpeg.OriginalWidth / 2
Jpeg.Height = Jpeg.OriginalHeight / 2
Save the picture
Jpeg.Save Server.MapPath("images") & "/clock_small.jpg"
%>
[code]