using System; using System.Drawing; using System.IO; using System.Reflection; using System.Windows.Forms; using Timer = System.Windows.Forms.Timer; namespace CramLinkClientGUI { public partial class SplashForm : Form { private Timer fadeTimer; public SplashForm() { InitializeComponent(); StartFadeIn(); LoadLogo(); } private void StartFadeIn() { this.Opacity = 0; fadeTimer = new Timer(); fadeTimer.Interval = 30; // ms fadeTimer.Tick += (s, e) => { if (this.Opacity < 1) this.Opacity += 0.05; else fadeTimer.Stop(); }; fadeTimer.Start(); } private void LoadLogo() { var assembly = Assembly.GetExecutingAssembly(); using Stream stream = assembly.GetManifestResourceStream("CramLink_v2.Assets.logo.png"); if (stream != null) logoBox.Image = Image.FromStream(stream); } } }