24 lines
571 B
C#
24 lines
571 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ProjetTheAlone.Outil
|
|
{
|
|
class picToByteArray
|
|
{
|
|
public static byte[] Convert(string imgPath)
|
|
{
|
|
FileStream fs = new System.IO.FileStream(@".\desert.jpg", FileMode.Open, FileAccess.Read);
|
|
BinaryReader br = new BinaryReader(fs);
|
|
byte[] result = br.ReadBytes((int)fs.Length);
|
|
br.Close();
|
|
fs.Close();
|
|
|
|
return result;
|
|
}
|
|
}
|
|
}
|