forked from Teknikode/Teknik
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
625 B
26 lines
625 B
using System; |
|
using System.Collections.Generic; |
|
using System.Linq; |
|
using System.Text; |
|
using System.Threading.Tasks; |
|
using System.Drawing; |
|
using System.IO; |
|
|
|
namespace Teknik.Utilities |
|
{ |
|
public static class ByteHelper |
|
{ |
|
public static byte[] ImageToByte(Image img) |
|
{ |
|
byte[] byteArray = new byte[0]; |
|
using (MemoryStream stream = new MemoryStream()) |
|
{ |
|
img.Save(stream, System.Drawing.Imaging.ImageFormat.Png); |
|
stream.Close(); |
|
|
|
byteArray = stream.ToArray(); |
|
} |
|
return byteArray; |
|
} |
|
} |
|
}
|
|
|