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
Post a Comment