GUI/SensorNotifyIcon.cs
changeset 117 14329d236f05
parent 116 c92e98bc2073
child 118 407f98562c3b
     1.1 --- a/GUI/SensorNotifyIcon.cs	Sat May 15 11:34:36 2010 +0000
     1.2 +++ b/GUI/SensorNotifyIcon.cs	Sat May 15 12:50:28 2010 +0000
     1.3 @@ -75,7 +75,7 @@
     1.4          "traycolor").ToString(), defaultColor);      
     1.5        
     1.6        this.pen = new Pen(Color.FromArgb(96, Color.Black));
     1.7 -      this.font = new Font(SystemFonts.MessageBoxFont.FontFamily, 9);
     1.8 +      this.font = SystemFonts.MessageBoxFont;
     1.9  
    1.10        ContextMenuStrip contextMenuStrip = new ContextMenuStrip();
    1.11        ToolStripMenuItem removeItem = new ToolStripMenuItem("Remove");
    1.12 @@ -98,8 +98,11 @@
    1.13  
    1.14        this.bitmap = new Bitmap(16, 16, PixelFormat.Format32bppArgb);
    1.15        this.graphics = Graphics.FromImage(this.bitmap);
    1.16 -      this.graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
    1.17 -      this.graphics.SmoothingMode = SmoothingMode.HighQuality;
    1.18 +
    1.19 +      if (Environment.OSVersion.Version.Major > 5) {
    1.20 +        this.graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
    1.21 +        this.graphics.SmoothingMode = SmoothingMode.HighQuality;
    1.22 +      }
    1.23      }
    1.24  
    1.25      public ISensor Sensor {
    1.26 @@ -137,7 +140,6 @@
    1.27        if (darkBrush != null)
    1.28          darkBrush.Dispose();
    1.29        pen.Dispose();
    1.30 -      font.Dispose();
    1.31        graphics.Dispose();      
    1.32        bitmap.Dispose();      
    1.33      }
    1.34 @@ -164,7 +166,7 @@
    1.35  
    1.36        graphics.Clear(Color.Black);
    1.37        TextRenderer.DrawText(graphics, GetString(), font,
    1.38 -        new Point(-2, 0), Color.White, Color.Black);
    1.39 +        new Point(-2, 0), Color.White, Color.Black);        
    1.40  
    1.41        BitmapData data = bitmap.LockBits(
    1.42          new Rectangle(0, 0, bitmap.Width, bitmap.Height),