Ejemplo n.º 1
0
        public ImageData(SourceImage sourceImage, ProcessingTaskMonitor processingTaskMonitor)
        {
            _mainThreadDispatcher         = Dispatcher.CurrentDispatcher;
            _sourceImage                  = sourceImage;
            _sourceImage.PropertyChanged += SourceImage_PropertyChanged;
            _processingTaskMonitor        = processingTaskMonitor;
            RunTheWorkerThread();

            ResetDisplayImage();
        }
Ejemplo n.º 2
0
        public ImageProcessorViewModel(ImageData imageData, ProcessingTaskMonitor processingTaskMonitor, SourceImage sourceImage)
        {
            this._imageData             = imageData;
            this._sourceImage           = sourceImage;
            this._processingTaskMonitor = processingTaskMonitor;
            this._processingTaskMonitor.PropertyChanged += ProcessingTaskMonitor_PropertyChanged;


            this._imageData.PropertyChanged   += ImageData_PropertyChanged;
            this._sourceImage.PropertyChanged += _sourceImage_PropertyChanged;
        }
        public SourceImage(ProcessingTaskMonitor processingTaskMonitor)
        {
            _mainThreadDispatcher = Dispatcher.CurrentDispatcher;
            string imageUriString = "pack://application:,,,/angry face.jpg";

            try
            {
                var          resourceStream = App.GetResourceStream(new Uri(imageUriString));
                var          length         = resourceStream.Stream.Length;
                BinaryReader binaryReader   = new BinaryReader(resourceStream.Stream);
                this.ImageBinary = binaryReader.ReadBytes((int)length);
            }
            catch
            {
            }
        }