用bitmap将两个图绘制上去,然后上传合并后的图片
解决方案 »
- 比较着急的小问题!!!
- 一个关于Repeater控件的奇怪问题
- ASP.NET中数据绑定问题
- 新手请教,大家帮忙看看--在线
- 请问怎样通过程序控制MultiPage显示某个PageView
- 请问ASP.NET下的“字段资源管理器”在哪里?
- 呜!呜!呜! 大事不好!我装了oracle 9i 后,重启机后,我的IIS 就启动不了了,我右击,选启动,但是提示“地址已被使用”,我的 .net 项目
- 一个简单的ASP问题,高手帮忙指教!
- dropdownlist 选中的值不能改变
- 有哪位兄弟用过Microsoft Common Dialog Control?高分请教
- js执行完后获取网页源码
- Visual Studio Express 2013与mysql 5.6
{
if (maps.Length == 0)
throw new Exception("图片数不能够为0"); int _width = 0;
int _height = 0;
for (int i = 0; i < maps.Length; i++)
{
if (RepeatDirection == ArrangeDirection.Left)
{
_width += maps[i].Width;
if (maps[i].Height > _height)
{
_height = maps[i].Height;
}
}
else
{
_height += maps[i].Height;
if (maps[i].Width > _width)
{
_width = maps[i].Width;
}
}
}
//创建要显示的图片对象,根据参数的个数设置宽度
Bitmap backgroudImg = new Bitmap(_width, _height);
Graphics g = Graphics.FromImage(backgroudImg); //清除画布,背景设置为白色
int len = maps.Length;
g.Clear(System.Drawing.Color.White);
int x = 0;
for (int j = 0; j < len; j++)
{
if (RepeatDirection == ArrangeDirection.Left)
{
g.DrawImage(maps[j], x, 0, maps[j].Width, maps[j].Height);
x = x + maps[j].Width;
}
else
{
g.DrawImage(maps[j], 0, x, maps[j].Width, maps[j].Height);
x = x + maps[j].Height;
}
}
g.Dispose();
return backgroudImg;
}
MergerImg(Bitmap[] maps,System.Windows.Forms.ArrangeDirection RepeatDirection)maps图片集
RepeatDirection横向合并/垂直合并