/// <summary> /// create a byte array based on total led count. /// </summary> /// <param name="ledCountModel"></param> /// <returns></returns> public static byte[] CreateByteArray(ScreenLedCountModel ledCountModel) { var newLength = ledCountModel.TotalSum() * 3; var arrayRGB = new byte[newLength]; return(arrayRGB); }
private bool GetLedCount() { try { _screenLedCount = _screenLedCount ?? new ScreenLedCountModel(); _screenLedCount.HorizontalLedCountTop = byte.Parse(HorizontalLedCountTop.Text); _screenLedCount.HorizontalLedCountBottom = byte.Parse(HorizontalLedCountBottom.Text); _screenLedCount.VerticalLedCountLeft = byte.Parse(VerticalLedCountLeft.Text); _screenLedCount.VerticalLedCountRight = byte.Parse(VerticalLedCountRight.Text); return(true); } catch (Exception) { return(false); } }