private void btnBrowseSignature_Click(object sender, RoutedEventArgs e)
        {
            var openFileDialog = new OpenFileDialog
            {
                CheckFileExists = true,
                Filter          = string.Format("Image Files (*)|*.bmp;*.gif;*.jpg"),
                Title           = String.Format("Signature Browser")
            };

            if (openFileDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }
            _member.ContactInformation.Signature = ImageTool.GetBytesFromImageFile(openFileDialog.FileName);
            imgSignature.Source = ImageTool.CreateImageSourceFromBytes(_member.ContactInformation.Signature);
        }
示例#2
0
        private void FindImage()
        {
            var openFileDialog = new OpenFileDialog
            {
                CheckFileExists = true,
                Filter          = string.Format("Image Files|*.bmp;*.gif;*.jpg; *.png"),
                DefaultExt      = "PNG",
                Title           = String.Format("Select Product Image")
            };

            openFileDialog.InitialDirectory = Environment.SpecialFolder.MyDocuments.ToString();
            if (openFileDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            _newItem.Image    = ImageTool.GetBytesFromImageFile(openFileDialog.FileName);
            ReportLogo.Source = ImageTool.CreateImageSourceFromBytes(_newItem.Image);
        }