private void objectListView1_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e) { if (e.ColumnIndex == 2) e.SubItem.ForeColor = primaryCellColor; else e.SubItem.ForeColor = otherCellColor; if (e.ColumnIndex != 0) return; // Setup album artwork column Song song = (Song)e.Model; if (song.TrackNumber == 1) { Image albumCover = this.GetAlbumArtwork(song); if (albumCover != null) { // albumCover = albumCover.GetThumbnailImage(120, 120, delegate { return false; }, IntPtr.Zero); ImageDecoration decoration = new ImageDecoration(albumCover); decoration.ShrinkToWidth = true; decoration.AdornmentCorner = ContentAlignment.BottomCenter; decoration.ReferenceCorner = ContentAlignment.TopCenter; e.SubItem.Decoration = decoration; albumImageDecorations[song.Album] = new ForwardingDecoration(e.Item, e.SubItem, decoration); TextDecoration td = new TextDecoration(song.Album, ContentAlignment.BottomCenter); td.Font = this.objectListView1.Font; td.Wrap = false; td.TextColor = primaryCellColor; td.BackColor = Color.FromArgb(255, 16, 16, 16); td.CornerRounding = 4; //td.BackColor = otherCellColor; //td.TextColor = Color.FromArgb(255, 16, 16, 16); //td.CornerRounding = 0; e.SubItem.Decorations.Add(td); } } else { if (albumImageDecorations.ContainsKey(song.Album)) { e.SubItem.Decoration = albumImageDecorations[song.Album]; } } }
private void lstGames_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e) { if (e.ColumnIndex != 0) return; if (e.Model == null) return; // Add game banner to ID column GameInfo g = (GameInfo)e.Model; string bannerFile = string.Format(Properties.Resources.GameBannerPath, Path.GetDirectoryName(Application.ExecutablePath), g.Id); if (!File.Exists(bannerFile)) return; ImageDecoration decoration = new ImageDecoration(Image.FromFile(bannerFile)); decoration.ShrinkToWidth = true; decoration.AdornmentCorner = ContentAlignment.TopLeft; decoration.ReferenceCorner = ContentAlignment.TopLeft; decoration.Transparency = 255; //e.SubItem.Decoration = decoration; e.SubItem.Decorations.Add(decoration); // Add Early Access banner if (Program.GameDB.Games.ContainsKey(g.Id) && Program.GameDB.Games[g.Id].Tags != null) { if (Program.GameDB.Games[g.Id].Tags.Contains(EARLY_ACCESS)) { decoration = new ImageDecoration(imglistEarlyAccess.Images[0]) { AdornmentCorner = ContentAlignment.TopLeft, ReferenceCorner = ContentAlignment.TopLeft, Transparency = 200 }; e.SubItem.Decorations.Add(decoration); } } TextDecoration td = new TextDecoration(g.Id.ToString(), ContentAlignment.BottomLeft) { Font = new Font(this.lstGames.Font.Name, 8), Wrap = false, TextColor = textColor, BackColor = listBackground, CornerRounding = 4, Transparency = 200 }; e.SubItem.Decorations.Add(td); }
private void objectListView1_FormatCell(object sender, FormatCellEventArgs e) { if (e.ColumnIndex == 2 && e.SubItem.Text.Trim() == "") { TextDecoration decoration = new TextDecoration("Jälki-ilmoittautumispaikka", 200); decoration.Alignment = ContentAlignment.MiddleLeft; decoration.Font = new Font(this.Font.Name, this.Font.SizeInPoints + 1); decoration.TextColor = Color.Gray; e.SubItem.Decoration = decoration; } }
private void lstGames_FormatCell(object sender, BrightIdeasSoftware.FormatCellEventArgs e) { if (e.ColumnIndex != 0) return; // Add game banner to ID column GameInfo g = (GameInfo)e.Model; ImageDecoration decoration = new ImageDecoration(g.Banner()); decoration.ShrinkToWidth = true; decoration.AdornmentCorner = ContentAlignment.TopLeft; decoration.ReferenceCorner = ContentAlignment.TopLeft; decoration.Transparency = 255; e.SubItem.Decoration = decoration; TextDecoration td = new TextDecoration(g.Id.ToString(), ContentAlignment.BottomLeft); td.Font = new Font(this.lstGames.Font.Name, 8); td.Wrap = false; td.TextColor = textColor; td.BackColor = listBackground; td.CornerRounding = 4; td.Transparency = 200; e.SubItem.Decorations.Add(td); }