private void ConvertImage(object param) { if (ip != null) { FunctionTimeChecker ftc = new FunctionTimeChecker(); ftc.CheckFunctionTime(ip.ToMainColors); OperationTime = ftc.ElapsedMs; OperationTimeText = "Function time was: " + OperationTime + "ms"; Image = ip.LoadBitmap(); CanSave = true; } }
private void LoadImage(object param) { Microsoft.Win32.OpenFileDialog imageFileDialog = new OpenFileDialog(); imageFileDialog.Filter = "JPEG files (*.jpg, *.jpeg)|*.jpg; *.jpeg|PNG files (*.png)|*.png|" + "BMP files (*.bmp)|*.bmp"; imageFileDialog.FilterIndex = 1; imageFileDialog.RestoreDirectory = true; bool?result = imageFileDialog.ShowDialog(); if (result == true) { FileName = imageFileDialog.FileName; ip = new ImageProcessing.ImageProcessing(); ip.bitmap = brw.ReadImage(FileName); Image = ip.LoadBitmap(); FileName = brw.GetFileImageName(); } }