narsil/Tanshu.Accounts.PointOfSale/SplashForm.cs

36 lines
1.1 KiB
C#
Raw Normal View History

using System;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
using Tanshu.Accounts.Repository;
namespace Tanshu.Accounts.PointOfSale
{
public partial class SplashForm : Form
{
public SplashForm()
{
InitializeComponent();
}
private void SplashForm_Paint(object sender, PaintEventArgs e)
{
// For an image added as a project resource in Visual Studio,
// get the resource by name.
// Bitmap backgroundImage = Properties.Resources.mypicture;
// Otherwise, get the image compiled as an embedded resource.
Assembly asm = Assembly.GetExecutingAssembly();
Bitmap backgroundImage = new Bitmap(asm.GetManifestResourceStream("Splash"));
e.Graphics.DrawImage(backgroundImage, this.ClientRectangle,
new Rectangle(0, 0, backgroundImage.Width, backgroundImage.Height),
GraphicsUnit.Pixel);
}
private void SplashForm_Load(object sender, EventArgs e)
{
SessionManager.Initialize();
this.Close();
}
}
}