private void btnDecreaseDesiredHeight_Click(object sender, EventArgs e) { try { String selMod = Convert.ToString(comTargetMod.SelectedItem); txtDesiredHeight.Text = (Resizer.ClosestMod(Int64.Parse(txtDesiredHeight.Text), Int64.Parse(selMod)) - Int64.Parse(selMod)).ToString(); } catch (Exception ex) { ShowExceptionMessage(ex); } }
private void calculateValues() { if (refreshResizer()) { String selMod = Convert.ToString(comTargetMod.SelectedItem); Int64 desW = 0; Int64 desH = 0; try { if (chkDesiredHeight.Checked) { if (txtDesiredHeight.Text.Length > 0) { desH = Resizer.ClosestMod(Int64.Parse(txtDesiredHeight.Text), Int64.Parse(selMod)); } else { desH = Resizer.ClosestMod(Int64.Parse(txtOriginalHeight.Text), Int64.Parse(selMod)); } rsz.CalculateValuesForDesiredHeight(desH); } else { if (txtDesiredWidth.Text.Length > 0) { desW = Resizer.ClosestMod(Int64.Parse(txtDesiredWidth.Text), Int64.Parse(selMod)); } else { desW = Resizer.ClosestMod(Int64.Parse(txtOriginalWidth.Text), Int64.Parse(selMod)); } rsz.CalculateValuesForDesiredWidth(desW); } rsz.CalculateAnamorphicValues(); refreshResults(); } catch { clearResults(); return; } } else { clearResults(); } }