Set Photo = Server.CreateObject(“Persits.Jpeg”) PhotoPath = Server.MapPath(“images”) & “\dodge_viper.jpg” Photo.Open PhotoPath Set Logo = Server.CreateObject(“Persits.Jpeg”) LogoPath = Server.MapPath(“images”) & “\clock.jpg” Logo.Open LogoPath Logo.Width = 70 Logo.Height = Logo.Width * Logo.OriginalHeight / Logo.OriginalWidth Photo.DrawImage 0, 0, Logo
Canvas.Line(Left, Top, Right, Bottom) 画一条直线 Canvas.Ellipse(Left, Top, Right, Bottom) 画出一个椭圆 Canvas.Circle(X, Y, Radius) 画出一个圆 Canvas.Bar(Left, Top, Right, Bottom) 画出一个长方形,上面有代码介绍了 Canvas.Font.ShadowColor 文字阴影颜色 Canvas.Font.ShadowXOffset As Long 阴影X坐标设定 Canvas.Font.ShadowYOffset As Long Y坐标设定 Canvas.Font.BkMode As String 文字背景
<% set obj=server.CreateObject(“wsImage.Resize”) ””””调用组件 obj.LoadSoucePic server.mappath(“25.jpg”) ””””打开图片,图片名字是25.jpg obj.GetSourceInfo iWidth,iHeight response.write “图片宽度:” & iWidth & “<br>” ””””获得图片宽度 response.write “图片高度:” & iHeight & “<br>” ””””获得图片高度 strError=obj.errorinfo if strError<>”" then response.write obj.errorinfo end if obj.free set obj=nothing %>
<% set obj=server.CreateObject(“wsImage.Resize”) obj.LoadSoucePic server.mappath(“25.jpg”) ””””装载图片 obj.Quality=75 obj.TxtMarkFont = “华文彩云” ””””设置水印文字字体 obj.TxtMarkBond = false ””””设置水印文字的粗细 obj.MarkRotate = 0 ””””水印文字的旋转角度 obj.TxtMarkHeight = 25 ””””水印文字的高度 obj.AddTxtMark server.mappath(“txtMark.jpg”), “带你离境”, &H00FF00&, 10, 70 strError=obj.errorinfo ””””生成图片名字,文字颜色即水印在图片的位置 if strError<>”" then response.write obj.errorinfo end if obj.free set obj=nothing %>
<% set obj=server.CreateObject(“wsImage.Resize”) obj.LoadSoucePic server.mappath(“25.jpg”) ””””装载图片 obj.LoadImgMarkPic server.mappath(“blend.bmp”) ””””装载水印图片 obj.Quality=75 obj.AddImgMark server.mappath(“imgMark.jpg”), 315, 220,&hFFFFFF, 70 strError=obj.errorinfo ””””生成图片名字,文字颜色即水印在图片的位置 if strError<>”" then response.write obj.errorinfo end if obj.free set obj=nothing %>
<% set obj=server.CreateObject(“wsImage.Resize”) obj.LoadSoucePic server.mappath(“25.jpg”) obj.Quality=75 obj.cropImage server.mappath(“25_crop.jpg”),100,10,200,200 ””””定义裁减大小和生成图片名字 strError=obj.errorinfo if strError<>”" then response.write obj.errorinfo end if obj.free set obj=nothing %>
<% set obj=server.CreateObject(“wsImage.Resize”) obj.LoadSoucePic server.mappath(“25.jpg”) ””””加载图片 obj.Quality=75 obj.OutputSpic server.mappath(“25_s.jpg”),0.5,0.5,3 ””””定义缩略图的名字即大小 strError=obj.errorinfo if strError<>”" then response.write obj.errorinfo end if obj.free set obj=nothing %>
水印效果如下: (责任编辑:admin) |