我使用ASP.NET MVC..。我使用图像采集器,我需要水印图像。如果我使用文本作为水印,就没有问题了。但是当我使用png图像作为水印时,它不起作用。水印不会出现在我的图像上。我该如何解决这个问题?
谢谢。注:存在watermark.png
imageJob = new ImageResizer.ImageJob(file,
Const.UploadFolder + "_<guid>.<ext>",
new ImageResizer.ResizeSettings(
"watermark=test1;width=1024;quality=100;format=jpg;mode=max"));
imageJob.CreateParentDirectory = true;
imageJob.Build();
//web.config
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="resizer" type="ImageResizer.ResizerSection" />
</configSections>
<resizer>
<plugins>
<add name="Watermark" />
</plugins>
<image name="test1" path="~/watermarks/watermark.png" align="topleft" width="100%" height="100%" relativeTo="canvas" drawAs="Background"></image>
</resizer>发布于 2014-11-05 18:24:31
XML无效。标记必须包含在元素中。关于一个例子,请参见文献资料。
https://stackoverflow.com/questions/26761111
复制相似问题