/* populate all user Photos in panelPictures */ private void populatePhotos() { try { Size smallSize = new Size(50, 50); if (FacebookEngine.Instance.FetchUserPhotos().Count == 0) { this.flowLayoutPanelPictures.Controls.Add(new Control("No Images Found")); } else { foreach (FacebookWrapper.ObjectModel.Photo photo in FacebookEngine.Instance.FetchUserPhotos()) { extendedPictureBox pic = new extendedPictureBox(); pic.Name = photo.Name + photo.Id; pic.Load(photo.PictureNormalURL); pic.Size = smallSize; pic.SizeMode = PictureBoxSizeMode.StretchImage; IDecoratedPictureBox pic2 = new DecoratedPictureBox(new DecoratorMargin(new CorePictureBox(pic), new Padding(1))); IDecoratedPictureBox pic3 = new DecoratorBackColor(pic2, this.BackColor); IDecoratedPictureBox pic4 = new DecoratorPadding(pic3, new Padding(2)); this.flowLayoutPanelPictures.Invoke(new Action(() => flowLayoutPanelPictures.Controls.Add(pic4.getPictureBoxItem()))); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/* populate all user Photos in panelPictures */ private void populatePhotos() { try { Size smallSize = new Size(50, 50); if (FacebookEngine.Instance.FetchUserPhotos().Count == 0) { this.flowLayoutPanelPictures.Controls.Add(new Control("No Images Found")); } else { foreach (FacebookWrapper.ObjectModel.Photo photo in FacebookEngine.Instance.FetchUserPhotos()) { PictureBox pic = new extendedPictureBox(); pic.Load(photo.PictureNormalURL); pic.Size = smallSize; pic.SizeMode = PictureBoxSizeMode.StretchImage; this.flowLayoutPanelPictures.Invoke(new Action(() => flowLayoutPanelPictures.Controls.Add(pic))); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }