图片添加透明文字水印
2009-05-24 13:10
411 查看
实现:通过GDI+中颜色是ARGB格式的(a,r,g,b)a透明度0-100,100表示不透明,0表示完全透明,r红色,g绿色,b蓝色
new SolidBrush(Color.FromArgb(80,70,140,40))
例子:
图片添加透明文字
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
namespace IPImage
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "image/jpeg";
Font font = new Font("Arial", 22);
string strFileName = @"D:\images\IpImg.bmp";
Image MyImage = Image.FromFile(strFileName);
Bitmap OutPut = new Bitmap(MyImage);
Graphics GImage = Graphics.FromImage(OutPut);
GImage.DrawString("第8工作室.热诚为您服务.", font, new SolidBrush(Color.FromArgb(80,70,140,40)),10,85);
OutPut.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
GImage.Dispose();
OutPut.Dispose();
MyImage.Dispose();
}
}
}
附源码:下载
new SolidBrush(Color.FromArgb(80,70,140,40))
例子:
图片添加透明文字
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
namespace IPImage
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "image/jpeg";
Font font = new Font("Arial", 22);
string strFileName = @"D:\images\IpImg.bmp";
Image MyImage = Image.FromFile(strFileName);
Bitmap OutPut = new Bitmap(MyImage);
Graphics GImage = Graphics.FromImage(OutPut);
GImage.DrawString("第8工作室.热诚为您服务.", font, new SolidBrush(Color.FromArgb(80,70,140,40)),10,85);
OutPut.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
GImage.Dispose();
OutPut.Dispose();
MyImage.Dispose();
}
}
}
附源码:下载
相关文章推荐
- 生成高清缩略图; 添加图片、文字水印; 图片、文字水印透明
- 给图片添加透明文字水印的方法
- java添加透明的图片和文字水印
- 生成高清缩略图; 添加图片、文字水印; 图片、文字水印透明
- 如何用PS批量为照片添加图片和文字水印
- php 图片水印+文字水印函数,但是不能设置透明
- IOS 绘图实战之“图片添加文字或者水印”
- 使用lowagie给pdf添加文字和图片水印
- asp.net为图片添加文字水印
- 使用Java添加图片水印和文字水印
- phpcms添加图片文字水印效果
- 利用ffmpeg实现添加图片水印和文字水印,添加多个水印。代码和命令实现及中文水印乱码
- 给图片添加文字水印
- asp .net 为图片添加文字水印(内包含有加图片水印的方法,但尚未完善暂不能使用)
- C#中基于GDI+(Graphics)图像处理系列之文字或者图片水印(透明、任意角度旋转)
- IOS:手写签名的实现(实现了手势绘制字体,添加文字水印,图片剪切、图片压缩)
- php面向对象与面向过程两种方法给图片添加文字水印
- 利用php给图片添加文字水印--面向对象与面向过程俩种方法的实现
- 上传图片 并生成缩略图 并添加文字水印
- php图片添加文字水印实现代码