private void ProcessSizes() { Resource.SDS.Code currentCode = null; _sizes = new List <ushort[]>(); int posWidth, posHeight; ushort[] currentSize; for (int i = 0; i < _messages.Count; i++) { currentCode = _segmentsCode[i]; currentSize = new ushort[2]; posWidth = currentCode.Content.Length - 12; posHeight = currentCode.Content.Length - 10; currentSize[0] = BitConverter.ToUInt16(new byte[2] { currentCode.Content[posWidth], currentCode.Content[posWidth + 1] }, 0); currentSize[1] = BitConverter.ToUInt16(new byte[2] { currentCode.Content[posHeight], currentCode.Content[posHeight + 1] }, 0); _sizes.Add(currentSize); } }
public void ReplaceSize(int index, ushort[] size) { byte[] width = BitConverter.GetBytes(size[0]); byte[] height = BitConverter.GetBytes(size[1]); Resource.SDS.Code SegmentCode = SegmentsCode[index]; int posWidth = SegmentCode.Content.Length - 12; int posHeight = SegmentCode.Content.Length - 10; SegmentCode.SetCodeBytes(width, posWidth); SegmentCode.SetCodeBytes(height, posHeight); ProcessSizes(); }