c# imagebox右击
嗨,朋友们,
撰写如此简单的文章的原因是,经过大量搜索后,我才知道没有太多人意识到Silverlight中没有Picturebox,而替代品是Imagebox。
这是如何使用Imagebox的基本示例。
This you can code on click event of button or anywhere according to your requirement,it will open a dialog box and let u select a image.
Here image1 is my Imagebox name.
OpenFileDialog objFileDialog = new OpenFileDialog();
bool? IsSelected = objFileDialog.ShowDialog();
objFileDialog.Filter = "Pictures (*.jpg)|*.jpg";
objFileDialog.FilterIndex = 1;
if (IsSelected == true)
{
BitmapImage bitImage = new BitmapImage();
bitImage.SetSource(objFileDialog.File.OpenRead());
image1.Source = bitImage;
//Image1 is object of Image
}
翻译自: https://bytes.com/topic/software-development/insights/916646-using-imagebox-silverlight-c-net-code
c# imagebox右击
本文介绍在Silverlight环境下使用Imagebox组件来选择并显示图片的方法。通过一个简单的示例,演示了如何在点击事件中打开文件对话框,让用户选择图片,并将所选图片设置为Imagebox的源。
506

被折叠的 条评论
为什么被折叠?



