2张gif的静态图片,都是50*50的,如何把他做成一张100*50的,就是连接成一张图片,而且图片质量不要太差就好
解决方案 »
- 如何动态生成对像实例。
- application.exit如何关闭子线程
- vs2003项目导入vs2005中出错!!!!
- C#如何测试给定坐标点是否在GraphicsPath实例区域中?
- SmtpClient的问题
- 高分请教在TreeView的节点显示多行文字如何实现?
- 我是菜鸟,想问如何调整comboBox6的高度?
- 请问一个关于流式套接字的问题?
- 谁能我讲讲以上两行代码的具体作用是?
- 如何用.net操作word2003,功能包括可以获取word里面的内容,可以识别表格等?
- javascript:__doPostBack()
- C#中用dateTimePicker1.Value.Date问题...急
public static Image GetImage(Image img1, Image img2)
{
int width = img1.Width + img2.Width;
int height = img1.Height > img2.Height ? img1.Height : img2.Height;
Bitmap bmp = new Bitmap(width, height);
Graphics graphics = Graphics.FromImage(bmp); Rectangle rect1 = new Rectangle(0,0,img1.Width,img1.Height);
Rectangle rect2 = new Rectangle(rect1.Right,0,img2.Width,img2.Height);
graphics.DrawImage(
img1,
rect1,
0,
0,
img1.Width,
img1.Height,
GraphicsUnit.Pixel);
graphics.DrawImage(
img2,
rect2,
0,
0,
img2.Width,
img2.Height,
GraphicsUnit.Pixel); graphics.Flush();
graphics.Dispose(); return bmp;
}
自己写的话。。没试过。。
gif是动画,如果有多帧,那难道一帧一帧取出来然后合成一帧,然后把合成的帧都组回一个gif动画?
先用图片工具处理下不就完了
..要用程序搞定也可以
GDI+
建个100*50的画布,将两张图片放上去,
一合并不就OK了!
Image img1=new Bitmap(this.pictureBox1.Image,50,50);
Image img2=new Bitmap(this.pictureBox2.Image,50,50);
Graphics g=Graphics.FromImage(bmp);
g.DrawImage(img1,0,0);
g.DrawImage(img2,img1.Width,0);
this.pictureBox3.Image=(Image)bmp;
//在另一个帖子里回了啊?不满足要求?
现在把他们拼接起来,放到this.pictureBox3中