[longomatch/statebar: 5/13] Add Shield to teams templates



commit 492281f068d9daf829ebb0c6da93418964fec20b
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Sep 16 16:08:26 2011 +0200

    Add Shield to teams templates

 LongoMatch/Store/Templates/TeamTemplate.cs |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/LongoMatch/Store/Templates/TeamTemplate.cs b/LongoMatch/Store/Templates/TeamTemplate.cs
index 16b944f..ae7575e 100644
--- a/LongoMatch/Store/Templates/TeamTemplate.cs
+++ b/LongoMatch/Store/Templates/TeamTemplate.cs
@@ -20,6 +20,7 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using Mono.Unix;
+using Gdk;
 
 using LongoMatch.Common;
 using LongoMatch.Interfaces;
@@ -30,6 +31,10 @@ namespace LongoMatch.Store.Templates
 
 	public class TeamTemplate: List<Player>, ITemplate<Player>
 	{
+		private byte[] thumbnailBuf;
+		private const int MAX_WIDTH=100;
+		private const int MAX_HEIGHT=75;
+		
 		public TeamTemplate() {
 			TeamName = Catalog.GetString("default");
 		}
@@ -44,6 +49,17 @@ namespace LongoMatch.Store.Templates
 			set;
 		}
 		
+		public Pixbuf Shield {
+			get {
+				if(thumbnailBuf != null)
+					return new Pixbuf(thumbnailBuf);
+				else return null;
+			} set {
+				var pix = ImageUtils.Scale(value, MAX_WIDTH, MAX_HEIGHT);
+				thumbnailBuf = ImageUtils.Serialize(pix);
+			}
+		}
+		
 		public List<Player> PlayingPlayersList {
 			get {
 				return this.Where(p=>p.Playing).Select(p=>p).ToList();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]