Click here to Skip to main content
13,661,044 members
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 />

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

Posted 8-Jun-15 6:38am
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.

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 | Cookies | Terms of Service
Web01-2016 | 2.8.180810.1 | Last Updated 8 Apr 2016
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

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