ASP 怎么给图片统一加水印
ASP 怎么给图片统一加水印就是在图片的右下角 加上几个文字 统一用css控制 有好多图片从数据库中读取的
怎么实现
Public Function AddPersitsText(Path) '************加文字水印********************** Dim Jpeg Set Jpeg = Server.CreateObject("Persits.Jpeg") Jpeg.Open Server.MapPath(Path) '打开图片,Path为路片路径及名称 Jpeg.Canvas.Font.Color = &HFFFFFF '后6位为文字颜色 Jpeg.Canvas.Font.Family = "宋体" '文字字体 Jpeg.Canvas.Font.Bold = True '是否加粗 Jpeg.Canvas.Font.Size = 30 '字体大小 Jpeg.Canvas.Font.Quality = 2 Jpeg.Canvas.Font.ShadowXOffset = 1 Jpeg.Canvas.Font.ShadowYOffset = 1 '阴影效果 Jpeg.Canvas.Pen.Color = &HFFFFFF '水印背景颜色 Jpeg.Canvas.Pen.Width = 3 Jpeg.Canvas.Brush.Solid = False Jpeg.Canvas.Print (Jpeg.width-240)/2, Jpeg.height/2+30, "www." '水印显示在图片上的XY位置 Jpeg.Save Server.MapPath(Path) '保存水印图片 Set Jpeg = Nothing End Function Public Function AddPersitsJpeg(Path) '**************加图片水印******************* Dim photo,logo,photopath,logopath Set Photo = Server.CreateObject("Persits.Jpeg") PhotoPath = Server.MapPath(Path) 'Path为路片路径及名称 Photo.Open PhotoPath '打开图片 Set Logo = Server.CreateObject("Persits.Jpeg") LogoPath = Server.MapPath("../images/imglogo.gif") '水印图片的路径 Logo.Open LogoPath Logo.Width = 300 '水印图片的宽度 Logo.Height = Logo.Width * Logo.OriginalHeight / Logo.OriginalWidth Photo.Canvas.Pen.Color = &H000000 '水印背景颜色 Photo.Canvas.Pen.Width = 1 Photo.Canvas.Brush.Solid = False Photo.DrawImage (photo.width-350)/2, photo.height/2+30, Logo,0.1 photo.Save Server.MapPath(Path) ''水印显示在图片上的XY位置 Set logo = Nothing Set photo = Nothing End FunctionASPJPeg组件加水印的代码