日期:2014-05-17  浏览次数:20827 次

关于aspjpeg:为什么我做的水印这么差?

这个是我想要的效果。


这种外面加白框的,也是我想实现的

以下是我现在的,很差:
----------------------------------

这个水印图片用的是gif,效果很差


这个水印图片用的是png,更是不可理喻


这个是文字水印,不论我设什么字体,他都这样字体


我想要的字体是这三种中的任一一种。
另外,能给黑字体外再加个白框么?

以下是我的aspjpeg参数配置,请高手帮我看看应该怎么修改,才能实现上面几种我想要的效果。谢谢
--------------------------------
参数:
sSYText = "www.google.com"
  sSYFontColor = "000000"
  nSYFontSize = Clng("24")
  sSYFontName = "Verdana, Arial, Helvetica, sans-serif"
  sSYPicPath = "../imgs/wa.png"
  nSYMinSize = Clng("300")
  sSYShadowColor = "FFFFFF"
  nSYShadowOffset = Clng("2")
  sSYTextWidth = Clng("200")'文字水印宽、高
  nSYTextHeight = Clng("40")
  sSYPicWidth = Clng("20")'图片水印右边距、底边距
  nSYPicHeight = Clng("20")
  nSYalpha = 1

文字水印:
Jpeg.Canvas.Font.Color ="&H"&sSYFontColor 
  Jpeg.Canvas.Pen.Color ="&H"&sSYFontColor
  Jpeg.Canvas.Font.Family = "'"& sSYFontName &"'"
  Jpeg.Canvas.Font.Bold = True
  Jpeg.Canvas.Font.Size = nSYFontSize 
  Jpeg.Canvas.Font.BkColor=&H5FD211
  Jpeg.Canvas.Font.Quality = 4 '0 (Default), 1 (Draft), 2 (Proof), 3 (Non-Antialiased), 4 (Antialiased) 
  Jpeg.Canvas.Font.BkMode = "Transparent" ' to make antialiasing work
  Jpeg.Canvas.Print Jpeg.OriginalWidth-sSYTextWidth, Jpeg.OriginalHeight-nSYTextHeight, sSYText

  Jpeg.Canvas.Pen.Color ="&H"&sSYShadowColor 
  Jpeg.Canvas.Pen.Width = nSYShadowOffset
  Jpeg.Canvas.Brush.Solid = False 
  Jpeg.Canvas.DrawBar nSYShadowOffset, nSYShadowOffset, Jpeg.Width, Jpeg.Height

图片水印:
Jpeg.Canvas.Pen.Color = &HFFFFFF 
  Jpeg.Canvas.Pen.Width = 0  
  Jpeg.Canvas.Brush.Solid = False  
  Jpeg.Canvas.Bar 0, 0, Jpeg.Width, Jpeg.Height 
  Jpeg.Width = Jpeg.Width
  Jpeg.height = Jpeg.height
  Jpeg.Sharpen 1, 120
  Jpeg.DrawImage Jpeg.Width-Jpeg1.Width-sSYPicWidth, Jpeg.Height-Jpeg1.Height-nSYPicHeight, Jpeg1, nSYalpha, &HFFFFFF

------解决方案--------------------



我想这2张都应该是图片的水印。
------解决方案--------------------
<% 
LocalFile="d:\mytest.jpg" 
TargetFile="d:mytest_Text.jpg" 
Dim Jpeg 
Set Jpeg = Server.CreateObject("Persits.Jpeg") 
If -2147221005=Err then 
Response.write "没有这个组件,请安装!" ’检查是否安装AspJpeg组件 
Response.End() 
End If 
Jpeg.Open (LocalFile) ’打开图片 
If err.number then 
Response.write"打开图片失败,请检查路径!" 
Response.End() 
End if 
Dim aa 
aa=Jpeg.Binary ’将原始数据赋给aa 
’=========加文字水印================= 
Jpeg.Canvas.Font.Color = &Hfffffff ’水印文字颜色 
Jpeg.Canvas.Font.Family = Arial ’字体 
Jpeg.Canvas.Font.Bold = True ’是否加粗 
Jpeg.Canvas.Font.Size = 35 ’字体大小 
Jpeg.Canvas.Font.ShadowColor = &H000000 ’阴影色彩 
Jpeg.Canvas.Font.ShadowYOffset = 1 
Jpeg.Canvas.Font.ShadowXOffset = 1 
Jpeg.Canvas.Brush.Solid = True 
Jpeg.Canvas.Font.Quality = 4 ’ ’输出质量 
Jpeg.Canvas.PrintText Jpeg.OriginalWidth/2-100,Jpe