Salve, allora ho il seguente codice:
codice:
public void UpdatePosition()
{
// lock
Monitor.Enter(this);
if (autosize)
{
int width = 320;
int height = 240;
if (camera != null)
{
camera.Lock();
// get frame dimension
if (camera.LastFrame != null)
{
width = camera.LastFrame.Width;
height = camera.LastFrame.Height;
}
camera.Unlock();
}
//
this.SuspendLayout();
this.Size = new Size(width + 2, height + 2);
this.ResumeLayout(false);
}
// unlock
Monitor.Exit(this);
}
Allora secondo voi perchè se io vado in debug il controllo sottolineato è true invece se lancio senza andare in debug quel controllo è sempre null?
camera è di tipo Camera(una mia classe) che al suo interno ha anche
codice:
// LastFrame property
public Bitmap LastFrame
{
get { return lastFrame; }
}
Andando in debug vedo che chi valorizza il LastFrame è l'istruzione
Cosa sbaglio?
Grazie anticipatamente