图片的生成
只有背景的图片 怎么用这个作为背景并在背景的合适位置加上自己的一些东西生成另一张图片啊??
------解决方案--------------------Graphics自己画
------解决方案--------------------/// <summary>
/// 为图片增加水印
/// </summary>
/// <param name= "_img "> 添加水印的源图片 </param>
/// <param name= "_pos "> 水印的参考方位 </param>
/// <param name= "_offsizeX "> 横坐标上偏移量 </param>
/// <param name= "_offsizeY "> 纵坐标上偏移量 </param>
/// <param name= "_offsize "> 具体偏移量 </param>
/// <param name= "_mark "> 需要显示的水印 </param>
public void DrawWatermark(ref System.Drawing.Image _srcImg, Utility.ImagePos _pos, int _offsizeX, int _offsizeY, System.Drawing.Image _mark)//水印在图片中的位置全部从图片的(0,0)点开始
{
int srcX = _srcImg.Width;
int srcY = _srcImg.Height;
int x = 0;
int y = 0;
System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(_srcImg);
switch (_pos)
{
case Utility.ImagePos.TOPLEFT:
g.DrawImage(_mark, 0, 0);
break;
case Utility.ImagePos.TOPRIGHT:
x = srcX + _offsizeX - _mark.Width;
g.DrawImage(_mark, x, _offsizeY);
break;
case Utility.ImagePos.BOTTOMLEFT:
y = srcY + _offsizeY - _mark.Height;
g.DrawImage(_mark, _offsizeX, y);
break;
case Utility.ImagePos.BOTTOMRIGHT:
x = srcX + _offsizeX - _mark.Width;
y = srcY + _offsizeY - _mark.Height;
g.DrawImage(_mark, x, y);
break;
case Utility.ImagePos.CENTER:
break;
default:
break;
}
}
/// <summary>
/// 为图片增加水印,默认从(0,0)为开始点
/// </summary>
/// <param name= "_img "> 添加水印的源图片 </param>
/// <param name= "_pos "> 水印的参考方位 </param>
/// <param name= "_offsize "> 具体偏移量 </param>
/// <param name= "_offsizeX "> 横坐标偏移量 </param>
/// <param name= "_offsizeY "> 纵坐标偏移量 </param>
/// <param name= "_mark "> 需要显示的水印 </param>
public void DrawWatermark(ref System.Drawing.Image _srcImg, int _offsizeX, int _offsizeY, System.Drawing.Image _mark)//水印在图片中的位置全部从图片的(0,0)点开始
{
int srcX = _srcImg.Width;
int srcY = _srcImg.Height;
System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(_srcImg);
g.DrawImage(_mark, 0, 0);
}
------解决方案--------------------用GDI+来自己绘图了