Exemplo n.º 1
0
        private async void importImageButton_Click(object sender, RoutedEventArgs e)
        {
            var openingHandler = new OpeningHandler("Png files (*.png)|*.png|All files (*.*)|*.*");
            var path           = openingHandler.GetPath();

            if (path == null || path == "")
            {
                return;
            }

            await RunLongTask(ImageHandler.ImportFromImage(processor.Array, xDimension, yDimension, 600, path),
                              () => {
                ClearArray();
                InitializeColorsArray(processor.Array.Max());
                RefreshFullArray();
            });
        }
Exemplo n.º 2
0
        private async void importImage_Click(object sender, RoutedEventArgs e)
        {
            var openingHandler = new OpeningHandler("Png files (*.png)|*.png|All files (*.*)|*.*");
            var path           = openingHandler.GetPath();

            ImageHandler.ImportFromImage(builder.Array, xDimension, yDimension, 600, path);

            await Task.Run(() =>
            {
                renderingArray = new bool[xDimension, yDimension];
                Dispatcher.BeginInvoke((Action)(() =>
                {
                    ClearArray();
                    MakeColorsGrains(builder.Array.Max());
                    RefreshFullArray();
                }));
            });
        }