I need to convert image to binary and get result in text box .

Image found in path D:/person.jpg

i using the following function :

public bool[] imageToBinaryArray(System.Drawing.Image imageIn)
{
MemoryStream ms = new MemoryStream();
bool[] arr = new bool[50000000];
int i =0;
imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
BitArray bitarray = new BitArray(ms.ToArray());
foreach (bool item in bitarray)
{
arr[i] = item;
i++;
}
return arr;
}

How to receive the value returned from function imageToBinaryArray in textbox1 ?

A textbox displays text, it cannot display a boolean array. At the most it will interpret that array as text, which will look like rubbish.
To display pictures, use a picturebox.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.