'Automatically generate a shrunk graph Start set jpeg = server.createObject ("Persits.jpeg")' Get the source picture path Path = server.mappath (filename) 'Open source picture' response.write (path) jpeg.open path ' To generate a thumbnail detail here there are many settings: the method of setting the following is first judged to zoom in and scales IF JPEG.ORIGINALWIDTH / JPEG.WIDTH = 98 JPEG.HEight = int ((98 / jpeg .OriginalWidth) * Jpeg.OriginalHeight) elseif Jpeg.OriginalWidth / Jpeg.OriginalHeight <1 thenJpeg.Width = 98Jpeg.Height = int ((98 / Jpeg.OriginalWidth) * Jpeg.Height) end if 'set sharpening Jpeg. Sharpen 1, 130 'Generates thumbnails to the specified path JPEG.SAVE Server.mappath ("UploadPic / Small") & "& FileName1'Response.write FileName1'Response.write Server.MAppath (" UploadPic / Small ") &" / "& filename1 'Note these two session'Session (" ppp0 ") = gp_curpath & filename'Session (" ppp1 ") = gp_curpath &" small "& filenameset jpeg = Nothing' automatically generates the end of the diagram end
'Large image sampling start' Establishing instance set jpeg = server.createObject ("persits.jpeg") 'Open the target picture path = server.mappath (filename)' Open source Picture JPEG.Open Path 'Add a text watermark JPEG.CANVAS. Font.color = & hff0000 'red jpeg.canvas.font.family = "Song" jpeg.canvas.font.bold = true jpeg.canvas.print 10, 10, "Hangzhou Guangxiang"' Save Document JPEG.SAVE SERVER.MAPPATH ("UPLOADPIC") & "/" & filename1 'Logout SET JPEG = Nothing' big picture Watermarking end