private void UpdatePictureBoxImage(PannablePictureBox pannablePictureBox, ShortcutItemImage shortcutItemImage) { pannablePictureBox.SetImage(shortcutItemImage.CachedImage(), shortcutItemImage.Width, shortcutItemImage.Height, shortcutItemImage.X, shortcutItemImage.Y); }
private void UpdatePictureBoxOverlay(PannablePictureBox pannablePictureBox, ShortcutItem currentShortcutItem) { pannablePictureBox.ShowTextOverlay = currentShortcutItem.Properties.CurrentState.ShowNameOnSquare150X150Logo; pannablePictureBox.TextOverlayColor = currentShortcutItem.Properties.CurrentState.ForegroundText == "light" ? Color.White : Color.Black; pannablePictureBox.TextOverlay = Path.GetFileNameWithoutExtension(currentShortcutItem.ShortcutFileInfo.Name); }
public TileIconifierPanel() { InitializeComponent(); //Keep a reference to the pictureboxes in a field just for convenience _panPctMediumIcon = pannablePictureBoxControlPanelMedium.PannablePictureBox; _panPctSmallIcon = pannablePictureBoxControlPanelSmall.PannablePictureBox; AddEventHandlers(); }
private PannablePictureBoxMetaData GetSenderPictureBoxToMetaData(object sender) { PannablePictureBox senderPictureBox = null; if (sender.GetType() == typeof(PannablePictureBoxControlPanel)) { senderPictureBox = ((PannablePictureBoxControlPanel)sender).PannablePictureBox; } if (sender.GetType() == typeof(PannablePictureBox)) { senderPictureBox = (PannablePictureBox)sender; } if (senderPictureBox == null) { throw new InvalidCastException($@"Sender not valid type! Received {sender.GetType()}"); } return(_pannablePictureBoxMetaDatas.Single(p => p.PannablePictureBox == senderPictureBox)); }