萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> asp編程 >> asp 利用Persits.jpeg組件生成圖片

asp 利用Persits.jpeg組件生成圖片

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Response.Expires = 0

Pic = Request("p")
PointX = CInt(Request("x"))
PointY = CInt(Request("y"))
CutWidth = CInt(Request("w"))
CutHeight = CInt(Request("h"))
PicWidth = CInt(Request("pw"))
PicHeight = CInt(Request("ph"))

Set Jpeg = Server.CreateObject("Persits.Jpeg")
Jpeg.Open Server.MapPath(Pic)

縮放切割圖片
Jpeg.Width = PicWidth
Jpeg.Height = PicHeight
Jpeg.Crop PointX, PointY, CutWidth + PointX, CutHeight + PointY
 
輸出圖片
Response.ContentType = "image/jpeg"
Jpeg.SendBinary
%>

copyright © 萬盛學電腦網 all rights reserved