private void listBoxParticleList_SelectedIndexChanged(object sender, EventArgs e) { ParticleInfo p = listBoxParticleList.SelectedItem as ParticleInfo; if (p != null) { if (viewport != null) { viewport.EnqueueCommand(CommandType.Particle, p); } pictureBoxParticlePreview.Image = p.Preview; } }
private void addImageToParticleList(string f, bool makeThisImageSelected) { Image i = new Bitmap(f); ParticleInfo p = new ParticleInfo(); p.FileName = f; p.Preview = i.GetThumbnailImage(128, 128, null, IntPtr.Zero); p.DisplayName = Path.GetFileName(f) + " (" + i.Width + "x" + i.Height + ")"; int s = listBoxParticleList.Items.Add(p); if (makeThisImageSelected) listBoxParticleList.SelectedIndex = s; }
private void addImageToParticleList(string f, bool makeThisImageSelected) { Image i = new Bitmap(f); ParticleInfo p = new ParticleInfo(); p.FileName = f; p.Preview = i.GetThumbnailImage(128, 128, null, IntPtr.Zero); p.DisplayName = Path.GetFileName(f) + " (" + i.Width + "x" + i.Height + ")"; int s = listBoxParticleList.Items.Add(p); if (makeThisImageSelected) { listBoxParticleList.SelectedIndex = s; } }