how i pass image in This function
<pre><code>public byte[] imageToByteArray(System.Drawing.Image imageIn)
{
    Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
    dlg.FileName = "Document"; // Default file name
    dlg.DefaultExt = ".txt"; // Default file extension
    dlg.Filter = "Text documents (.txt)|*.txt"; // Filter files by extension
    Nullable&lt;bool&gt; result = dlg.ShowDialog(); // Show open file dialog box

    // Process open file dialog box results
    if (result == true)
    {
        // Open document
        string filename = dlg.FileName;
        txtBrowse.Text = filename;
    }
    ImageSource imageSource = new BitmapImage(new Uri(txtBrowse.Text));
    imgImageAdlut.Source = imageSource; ;
    byte[] array1 = null;
    //array1 = imageToByteArray();
}

public byte[] imageToByteArray(System.Drawing.Image imageIn)
{
    MemoryStream ms = new MemoryStream();
    imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
    return ms.ToArray();
}
</code></pre>
