3 Replies - 853 Views - Last Post: 31 December 2016 - 08:13 AM Rate Topic: -----

#1 ahmedba  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 141
  • Joined: 24-January 14

How to convert image to binary and get result in text box

Posted 30 December 2016 - 06:26 PM

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 ArrayList imageToBinaryArray1(System.Drawing.Image imageIn)
        {
            MemoryStream ms = new MemoryStream();
           byte[] arr = new byte[50000000];
            ArrayList al = new ArrayList();
            imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
            arr= ms.ToArray();
            foreach (byte item in arr)
            {
                al.Add(Convert.ToString(item, 2));
            }
            return al;
        }

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

I work in c# windows form c#

Is This A Good Question/Topic? 0
  • +

Replies To: How to convert image to binary and get result in text box

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13567
  • View blog
  • Posts: 54,133
  • Joined: 12-June 08

Re: How to convert image to binary and get result in text box

Posted 30 December 2016 - 06:29 PM

Byte array or binary?
Was This Post Helpful? 0
  • +
  • -

#3 ahmedba  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 141
  • Joined: 24-January 14

Re: How to convert image to binary and get result in text box

Posted 31 December 2016 - 04:10 AM

I need to convert image to binary string as 0 or 1 not byte array
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13567
  • View blog
  • Posts: 54,133
  • Joined: 12-June 08

Re: How to convert image to binary and get result in text box

Posted 31 December 2016 - 08:13 AM

Please do not create duplicate topics. Closing.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1