Esempio n. 1
0
 protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
 {
     if (e.Property == SourceProperty)
     {
         ContentImage = ImageTool.GetByteImage(Source);
     }
     base.OnPropertyChanged(e);
 }
Esempio n. 2
0
        private void BT_HeadImage_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog fileDialog = new OpenFileDialog();

            fileDialog.Filter = "*.png|*.png";
            fileDialog.ShowDialog();
            FileInfo file = new FileInfo(fileDialog.FileName);

            if (file.Length > 6000)
            {
                MessageBox.Show("选择文件过大 最大6KB");
            }
            else
            {
                HeadImageBytes           = IoTool.GetFileByte(fileDialog.FileName);
                IMG_UserHeadImage.Source = ImageTool.GetByteImage(fileDialog.FileName);
            }
        }