private async void btnLagarithmic_Click(object sender, EventArgs e) { btnLagarithmic.Enabled = false; Bitmap resultImg = await Task.Run(() => Contrast.Logarithmic(state.Image, 40)); state.Edit(resultImg); pictureViewer2.Image = state.Image; await pictureViewer2.HistogramView(); await pictureViewer2.GrayBandView(); btnLagarithmic.Enabled = true; }