Click here to Skip to main content
13,198,325 members (56,556 online)
Rate this:
 
Please Sign up or sign in to vote.
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 8-Jun-15 6:38am
Comments
   
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web04 | 2.8.171020.1 | Last Updated 8 Apr 2016
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100