public ImageDatas GetImageSegments() { List <string> Guids = new List <string>(); foreach (MazeModel mm in mazeModels) { if (string.IsNullOrEmpty(mm.guid)) { throw new Exception("Invalid Guid found in MazeModel!"); } Guids.Add(mm.guid); } ImageDatas imageDatas = new ImageDatas(Guids); MazeModel m; for (int i = 0; i < mazeModels.Count; i++) { m = mazeModels[i]; if (m.maze == null || m.maze.Length == 0 || m.segments == null || m.segments.Count == 0) { throw new Exception(string.Format("Invalid Image Data Found at Index {0}", i)); } // Adds maze path imageDatas.Add(new ImageData(m.maze, m.guid)); imageDatas.AddRange(m.segments.Select(t => new ImageData(t, m.guid))); } return(imageDatas); }
public void SetImages(ImageDatas ids) { MemoryStream ms; lvwSegments.Items.Clear(); ImageList imglist = new ImageList { ImageSize = new Size(100, 100) }; for (int i = 0; i < ids.Count; i++) { ms = new MemoryStream(ids[i].Data); imglist.Images.Add((Bitmap)Image.FromStream(ms)); lvwSegments.Items.Add(new ListViewItem { Text = ids[i].Index.ToString(), ImageIndex = i }); } lvwSegments.LargeImageList = imglist; }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImageDatas obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }