如何在图片框中添加多张图片 [英] How to add multiple picture in a picturebox
本文介绍了如何在图片框中添加多张图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在开发一个C#Windows应用程序,我正在捕捉图片,现在我的要求是我拍摄多张照片并将其保存到一个文件中。我怎样才能实现这个目标?
谢谢和问候
Indrajit Dasgupta
解决方案
private void onLoadImages ( object sender,System.EventArgs e)
{
OpenFileDialog ofd = new 打开文件对话框();
ofd.InitialDirectory = System.Environment.CurrentDirectory;
ofd.Filter = 图标(* .ico)| * .ico | BMPs(* .bmp) | * .bmp | GIF(* .gif)| * .gif | JPEGs(* .jp *)| * .jp * | PNGs(* .png)| * .png;
if (ofd.ShowDialog( this )!= DialogResult.Cancel)
{
Image img = Image.FromFile(ofd.FileName);
此 .pictureBox1.Image = new 位图(img,新大小( 32 , 32 ));
}
}
参考: http://www.vbforums.com/showthread.php?482298-1.1-Add-multiple-images-in-a-single-picturebox 一> [ ^ ]
Hi All,
I am developing a C# Windows application, where I am capturing picture, now my requirement is I am taking multiple picture and save it to a single file. How can I make it possible?
Thanks & Regards
Indrajit Dasgupta
解决方案
private void onLoadImages(object sender, System.EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.InitialDirectory = System.Environment.CurrentDirectory; ofd.Filter = "Icons (*.ico)|*.ico|BMPs (*.bmp)|*.bmp|GIFs (*.gif)|*.gif|JPEGs (*.jp*)|*.jp*|PNGs (*.png)|*.png"; if (ofd.ShowDialog(this) != DialogResult.Cancel) { Image img = Image.FromFile(ofd.FileName); this.pictureBox1.Image = new Bitmap(img, new Size(32, 32)); } }
refer from :http://www.vbforums.com/showthread.php?482298-1.1-Add-multiple-images-in-a-single-picturebox[^]
这篇关于如何在图片框中添加多张图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文