예제 #1
0
        private void ContrastToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Bitmap        copy = new Bitmap((Bitmap)this.pbInput.Image);
            FrmBrightness fb   = new FrmBrightness();

            OlahCitra.keBrightness(copy, fb.getBrightness());
            this.pbOutput.Image = copy;
        }
예제 #2
0
        private void BrightnessContrastToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (pbInput.Image == null)
            {
                MessageBox.Show("Citra belum ada!");
            }
            else
            {
                Bitmap        b  = new Bitmap((Bitmap)this.pbInput.Image);
                FrmBrightness fb = new FrmBrightness();
                fb.ShowDialog();

                // FYI: koding dibawah dijalankan setelah form Brightness ditutup.
                int nilaiBrightness = Convert.ToInt32(fb.tbBrightness.Text);
                int nilaiContrast   = Convert.ToInt32(fb.tbContrast.Text);
                b = OlahCitra.keBrightness(b, nilaiBrightness);
                pbOutput.Image = OlahCitra.keContrast(b, nilaiContrast);
            }
        }