c# imagebox右击_在Silverlight中使用带有C#.Net代码的Imagebox。

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右击

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值