/[EmuXPortal]/trunk/EmuXPortal/GameControl.cs
ViewVC logotype

Contents of /trunk/EmuXPortal/GameControl.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 139 - (show annotations) (download)
Thu Oct 4 22:23:14 2012 UTC (7 years, 11 months ago) by william
File size: 997 byte(s)
+ dispose graphics when finished loading

1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Drawing;
5 using System.Data;
6 using System.Linq;
7 using System.Text;
8 using System.Windows.Forms;
9
10 namespace EmuXPortal
11 {
12 public partial class GameControl : UserControl
13 {
14 private object image_lock = new object();
15 public GameControl() { InitializeComponent(); }
16 public Image GameImage { get { lock (image_lock) { return gameImage.Image; } } set { lock (image_lock) { gameImage.Image = value; } } }
17 public string GameName { get { return gameName.Text; } set { gameName.Text = value; } }
18 private void GameControl_Load(object sender, EventArgs e)
19 {
20 using (Graphics g = gameName.CreateGraphics())
21 {
22 Size size = g.MeasureString(gameName.Text, gameName.Font).ToSize();
23 gameName.Size = new Size(size.Width + 5, gameName.Size.Height);
24 }
25 }
26 }
27 }

  ViewVC Help
Powered by ViewVC 1.1.22