我需要使用此插件使用经典ASP为图像添加水印。我的这项工作部分使用了这段代码:
dim o, b, wm, layer,textlayer
Set b = CreateObject("ImageResizer.Configuration.Config")
Set wm = CreateObject("ImageResizer.Plugins.Watermark.WatermarkPlugin")
Set textlayer = CreateObject("ImageResizer.Plugins.Watermark.TextLayer")
Set layer = CreateObject("ImageResizer.Plugins.Watermark.Layer")
textlayer.Text = "Yeees"
textlayer.fontSize = 50
layer.fill = True
set layer("dd") = textlayer 'THIS IS FAILING
wm.NamedWatermarks("sfdf") = layer("dd") 'THIS IS FAILING TOO
wm.Install(b)
b.BuildImage "C:\lg1_1361_44.jpg", "C:\lg1_1361_44_WATER.png", "watermark=tessst&format=png"
答案 0 :(得分:0)
为什么要创建Layer的实例? TextLayer和ImageLayer是您要使用的类
我会放弃与' layer'相关的所有内容。而试试这个。
textLayer.fill = True
wm.NamedWatermarks("sfdf") = textLayer
您还需要"watermark=sfdf"
而不是" tessst"