Gestion repa Ok

This commit is contained in:
adri
2019-01-24 22:24:05 +01:00
parent 9e06f31677
commit ceffc1446e
107 changed files with 5340 additions and 621 deletions

View File

@@ -0,0 +1,23 @@
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;
}
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjetTheAlone.Outil
{
class toByteArray
{
public static byte[] Convert(byte?[] bytes)
{
byte[] bb = Array.ConvertAll<byte?, byte>(bytes,
delegate (byte? b)
{
return b.Value;
});
return bb;
}
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjetTheAlone.Outil
{
class toNullableByteArray
{
public static byte?[] Convert(byte[] bytes)
{
byte?[] bb = Array.ConvertAll<byte, byte?>(bytes,
delegate (byte b)
{
return b;
});
return bb;
}
}
}