Beispiel #1
0
        private void list_inmates_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            _my_sql_db m = new _my_sql_db();

            try
            {
                m._view_inmate_data(list_inmates.SelectedItem.ToString());
                sel_inmate_name.Text  = _cn;
                sel_inmate_pri.Text   = _pn;
                sel_inmate_term.Text  = _pno;
                sel_inmate_crime.Text = _ct;
                _app_brain           ap = new _app_brain();
                System.Drawing.Image i  = ap._fun(_cp);

                // sel_inmate_img.Source = (BitmapSource)i;
                //MemoryStream mem = new MemoryStream();
                //Byte[] buffer = Convert.FromBase64String(_cp);
                //mem.Position = 0;
                //mem.Write(buffer, 0, buffer.Count());
                //if (mem != null)
                //{
                //    System.Windows.Media.Imaging.BitmapImage bi = new BitmapImage();
                //    bi.StreamSource = mem;
                //    ImageSource k = (ImageSource)bi;
                //    sel_inmate_img.Source = k;
                //}
            }

            //try
            //{
            //
            //    ImageSourceConverter con = new ImageSourceConverter();
            //    var s = con.ConvertFrom(i);
            //    Stream ss;
            //    ss.Position = 0;
            //    JpegBitmapDecoder d = new JpegBitmapDecoder(BitmapCreateOptions.None, BitmapCacheOption.Default);
            //    sel_inmate_img.Source = (ImageSource)s;
            //}
            //catch (Exception u)
            //{
            //    System.Windows.Forms.MessageBox.Show("Test" + u.Message);
            //}

            //using (FileStream stream = new FileStream(System.Windows.Forms.Application.StartupPath + "\\temp_data\\in_use.jpg", FileMode.Create)) ;

            //System.Windows.Forms.MessageBox.Show(_cp);
            //db.picture = ap._to_string(_i);

            //sel_inmate_img.Source = System.Windows.Forms.Application.StartupPath + "\\temp_data\\in_img.jpg";
            //= (ImageSource)isc.ConvertFromString(_cp);

            catch (Exception ex)
            {
                Console.WriteLine("ERR_AT_LST_INM_SEL_CHGD +++ \n" + ex.Message);
            }
        }