0

i have a problem. When i run my code. I take this error. I couldnt understand why. Can you help me? and i am sorry for my bad english.

namespace K.K.Y.T

{ public partial class Anaform : Form { private Kamera k; private YuzBul yuz; public int kamera_start = 0;

    public Anaform()
    {
        InitializeComponent();
    }

    neuralnetwork nobj = new neuralnetwork();

    public void timer1_Tick_1(object sender, EventArgs e)
    {
        yuz.YuzBul_Metodu(this, KameraResim, YKesiti);

    }

    private void yüzBulToolStripMenuItem_Click(object sender, EventArgs e)
    {
        if (kamera_start == 1)
        {
            timer1.Enabled = true;
            yuz = new YuzBul();
        }
        else
        {
            MessageBox.Show("Önce kamerayı başlatınız","Uyarı");
        }
        richTextBox1.Text += "Yüz Bulma Başlatıldı...\n";
    }

    private void Yuz_Tut_Click(object sender, EventArgs e)
    {
        try
        {
            Ytut.Image = YKesiti.Image;
            richTextBox1.Text += "Yüz Tutuldu ...\n";
        }
        catch
        {
            MessageBox.Show("Tutulan bir yüz olduğundan emin olun !", "Uyarı");
        }
    }
    private void button1_Click(object sender, EventArgs e)
    {
        timer1.Enabled = false;
        richTextBox1.Text += "Yüz Bulma Durduruldu !\n";
        SaveFileDialog savepic = new SaveFileDialog();
        savepic.DefaultExt = "KKYT";
        savepic.Filter = "Bitmap files (*.bmp)|*.bmp|JPG files (*.jpg)|*.jpg|GIF files (*.gif)|*.gif|All files (*.*)|*.*";
        savepic.AddExtension = true;
        savepic.RestoreDirectory = true;
        savepic.Title = "Resim Kayıt";
        savepic.InitialDirectory = Application.StartupPath + "\\yuzler";

        if (savepic.ShowDialog() == DialogResult.OK)
        {

            Ytut.Image.Save(savepic.FileName);
            richTextBox1.Text += "Tutulan Yüz Veritabanına Eklendi...\n";
        }
        else
        {
            MessageBox.Show("Kayıt İşlemi Başarısız !!!");
        }

        savepic.Dispose();
        savepic = null;
        Application.Restart();
        richTextBox1.Text += "Yüz Kayıt Edildi...\nProgram Tekrar Başlatıldı...\n";

    }

An unhandled exception of type 'System.NullReferenceException' occurred in K.K.Y.T.exe

Additional information: Nesne başvurusu bir nesnenin örneğine ayarlanmadı.

0 Answers0