/// <summary> /// Executes the GetImageColorDepthCommand command. /// </summary> public void ExecuteGetImageColorDepthCommand() { if (!CommandCanProcessImage(new GetImageColorDepthCommand(), _viewer.Image)) { return; } using (GetImageColorDepthForm dlg = new GetImageColorDepthForm(_viewer)) { if (dlg.ShowProcessingDialog()) { GetImageColorDepthCommand command = (GetImageColorDepthCommand)dlg.GetProcessingCommand(); if (ExecuteProcessingCommand(command, false)) { if (command.Result.PixelFormat == PixelFormat.Undefined) { MessageBox.Show("Image color depth can not be reduced."); } else { MessageBox.Show(string.Format("Detected image color depth is {0}.", command.Result.PixelFormat)); } } } } }
/// <summary> /// Returns the image processing command. /// </summary> /// <returns>The image processing command.</returns> public override ProcessingCommandBase GetProcessingCommand() { GetImageColorDepthCommand command = new GetImageColorDepthCommand(); command.MaxInaccuracy = this.Parameter1; return(command); }