private void RefreshLiveLayout(ref LiveVideoStreamInfo liveVideoStreamInfo, ViewFrame viewFrame, int resolutionWidth, int resolutionHeight) { liveVideoStreamInfo.Handle = (uint)viewFrame.Hwnd.ToInt32(); liveVideoStreamInfo.XLocation = (int)((viewFrame.Column / Columns) * resolutionWidth); liveVideoStreamInfo.Width = (int)((viewFrame.ColumnSpan / Columns) * resolutionWidth); liveVideoStreamInfo.YLocation = (int)((viewFrame.Row / Rows) * resolutionHeight); liveVideoStreamInfo.Height = (int)((viewFrame.RowSpan / Rows) * resolutionHeight); }
public List <LiveVideoStreamInfo> GetStreamLayout(int resolutionWidth, int resolutionHeight) { var viewFramesVisible = ViewFrameList.Where(viewFrame => viewFrame.IsOpened && viewFrame.Visibility == Visibility.Visible); var viewFramesByDesending = viewFramesVisible.OrderBy(viewFrame => viewFrame.ViewOrder); var orderViewFrames = viewFramesByDesending.ToList(); List <LiveVideoStreamInfo> liveVideoStreamInfos = new List <LiveVideoStreamInfo>(); foreach (var orderViewFrame in orderViewFrames) { LiveVideoStreamInfo newLiveVideoStreamInfo = new LiveVideoStreamInfo(); RefreshLiveLayout(ref newLiveVideoStreamInfo, orderViewFrame, resolutionWidth, resolutionHeight); liveVideoStreamInfos.Add(newLiveVideoStreamInfo); } return(liveVideoStreamInfos); }