Code Snippet
private byte[] abc = null;
private void menuItemSnap_Click(object sender, EventArgs e)
{
CameraCaptureDialog camCapture = new CameraCaptureDialog();
camCapture.InitialDirectory = @"\My Documents\My Pictures";
camCapture.Mode = CameraCaptureMode.Still;
if (camCapture.ShowDialog() == DialogResult.OK)
{
fileName = camCapture.FileName; // Get filename and create image.
Show();
pictureBoxCamera.Image = new Bitmap(fileName);
pictureBoxCamera.SizeMode = PictureBoxSizeMode.StretchImage;
camCapture.Dispose();
}
else
{
this.Close();
}
FileStream fs = File.OpenRead(camCapture.FileName);
abc = new byte[fs.Length]; // removed byte[]
fs.Read(bytes, 0, bytes.Length);
}
private void SendQUERY()
{
// i want to get abc which is declared in previous method
if (abc != null)
{
// do something with abc
}
}