public bool WriteImgToTxt(string FilePath, byte[] Pixel) { SL_Digital_Util imgUtil = new SL_Digital_Util(); string TxtPath = Path.ChangeExtension(FilePath, "txt"); imgUtil.WriteByteToTxt(TxtPath, Pixel, true); return(true); }
private bool DatafromTxt(string FilePath, ref List <byte> lXferData) { string line; uint value = 0; SL_Digital_Util strUtil = new SL_Digital_Util(); StreamReader sr = new StreamReader(FilePath, System.Text.Encoding.Default); while ((line = sr.ReadLine()) != null) { string[] words = line.Split(DelimiterChars); foreach (string word in words) { if (strUtil.isStrtoUInt(word, ref value)) { lXferData.Add((byte)value); } } } return(true); }
private byte[] RdBytefromTxt(string FilePath) { string line; bool isRight = true; uint value = 0; SL_Digital_Util Util = new SL_Digital_Util(); List <byte> lXferData = new List <byte>(); StreamReader sr = new StreamReader(FilePath, System.Text.Encoding.Default); while ((line = sr.ReadLine()) != null) { string[] words = line.Split(DelimiterChars); foreach (string word in words) { isRight = Util.isStrtoUInt(word, ref value); if (isRight) { lXferData.Add((byte)value); } } } return(lXferData.ToArray()); }