public void ShowResult(DataModel.SearchResultFaceProperty record) { if (record == null) { return; } m_currentRecord = record; if (InvokeRequired) { Invoke(new Action <DataModel.SearchResultFaceProperty>(ShowResult), record); } else { int index = m_allrecords.FindIndex(item => item.GetBase().ObjKey == m_currentRecord.GetBase().ObjKey); if (index >= 0) { pageNavigatorEx1.Index = index + 1; } pageNavigatorEx1.MaxCount = m_allrecords.Count; m_currentRecord = record; advPropertyGrid1.SelectedObject = record; Image img = Common.GetImage(record.GetBase().OriFacePicPath); string[] pointStr = record.GetBase().FacePosition.Split(','); pictureBox5.Image = img; Graphics gs = Graphics.FromImage(img); Pen pen = new Pen(Color.Red, 3); gs.DrawRectangle(pen, Convert.ToInt32(pointStr[0]), Convert.ToInt32(pointStr[1]), Convert.ToInt32(pointStr[2]), Convert.ToInt32(pointStr[3])); } }
public void NextRecord() { if (m_allrecords.Count > 0) { if (m_currentRecord == null) { ShowResult(m_allrecords[0]); } else { int index = m_allrecords.FindIndex(item => item.GetBase().ObjKey == m_currentRecord.GetBase().ObjKey); if (index >= 0) { index++; if (index > m_allrecords.Count - 1) { index = m_allrecords.Count - 1; } ShowResult(m_allrecords[index]); } else { if (m_allrecords.Count > 0) { index = 0; ShowResult(m_allrecords[index]); } } } } }