Пример #1
0
        public async Task <bool> LoadImage()
        {
            bool bRst = true;

            try
            {
                var openFile = await m_storageFile.OpenReadAsync();

                m_bitmap = new BitmapImage();
                m_bitmap.SetSource(openFile);
                pictureBoxOriginal.Source = m_bitmap;

                m_softwareBitmap = await ComFunc.CreateSoftwareBitmap(m_storageFile, m_bitmap);

                m_strCurImgName = ComFunc.GetStringApplicationDataContainer(ComInfo.IMG_TYPE_SELECT_NAME);
                SelectLoadImage(m_strCurImgName);
            }
            catch (Exception)
            {
                bRst = false;
                return(bRst);
            }

            return(bRst);
        }
Пример #2
0
        public async void OnClickBtnShowHistgram(object sender, RoutedEventArgs e)
        {
            if (m_bitmap == null)
            {
                return;
            }

            var histgramData = new ComHistgramData();

            if (m_bitmap != null)
            {
                histgramData.SoftwareBitmapOriginal = await ComFunc.CreateSoftwareBitmap(m_storageFile, m_bitmap);
            }
            string strCurImgName = ComFunc.GetStringApplicationDataContainer(ComInfo.IMG_TYPE_SELECT_NAME);

            if (SelectGetStatus(strCurImgName) == (int)ComInfo.ImageProcStatus.Implemented)
            {
                histgramData.SoftwareBitmapAfter = SelectGetBitmap(strCurImgName);
            }
            if (m_bitmap != null)
            {
                Frame.Navigate(typeof(HistgramLiveChartsPage), histgramData);
            }
        }