Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
While it can not form the background picture into the PictureBox.

hi friedns.

I'm doing image analysis.
While coded form ahead seamless works.

but the forms have to work invisibly in the background
in this case I can not attach the picture into the PictureBox.

frmKamera Code:
<br />
        public void resimGoster()<br />
        {<br />
            pictureBox1.Image = Image.FromFile("Capture\\resim.jpg");<br />
        }<br />
<br />
        public  void resimCek()<br />
        {<br />
            MessageBox.Show("geldi");<br />
            resimGoster();<br />
        }<br />
<br />


control.cs code:
<br />
frmKamera frmK = Application.OpenForms["frmKamera"] as frmKamera;<br />
frmK.resimCek();<br />


error:
Object reference not set to an instance of an object.
{"Object reference not set to an instance of an object."}

thanks
Posted
Comments
Sergey Alexandrovich Kryukov 8-Jun-15 13:10pm    
PictureBox is not image. If you want to analyze images, look at images; they have nothing to do with showing them anywhere. The line throwing the exception is too unreasonable to consider it seriously; who knows why you hard-coded "frmKamera". Use the debugger.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900