wpf - How Convert Image To byte[]? -


i want sent image through network tcpclient , networkstream.

type of image (system.windows.controls.image)

now how can convert image bytes ?

thanks.

you have serialize image in order send via network.

image im = image.fromfile(@"c:\hello.jpg"); memorystream ms = new memorystream(); im.save(ms, system.drawing.imaging.imageformat.jpeg); byte[] barray = ms.toarray();  string str = string.empty; foreach (byte b in oimage) {     str += b.tostring(); } 

Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -