java如何给视频添加水印logo
发布网友
发布时间:2022-05-05 11:52
我来回答
共1个回答
热心网友
时间:2022-06-27 11:42
package com.jc.ts.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jc.ts.services.WaterMark;
public class WaterFilter implements Filter {
public void destroy() {
// TODO Auto-generated method stub
}
public void doFilter(ServletRequest arg0, ServletResponse arg1,
FilterChain arg2) throws IOException, ServletException {
HttpServletRequest request=(HttpServletRequest)arg0;
HttpServletResponse response=(HttpServletResponse)arg1;
//WaterMark.createMarkSize("南京ts", request, response);
//WaterMark.createMarkLogo("D:\\workspace\\mybook\\WebRoot\\images\\logo\\book.jpg", request, response);
WaterMark.createMarkLogo("D:\\workspace\\mybook\\WebRoot\\images\\logo\\book.jpg", request, response,20,30);
//注意路径为绝对路径且三个效果不能同时执行
}
public void init(FilterConfig arg0) throws ServletException {
// TODO Auto-generated method stub
}
}