From a4a35ad62e3e5be6ec179675232601b65ffd92bd Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 21 Jun 2023 19:40:31 +1000 Subject: [PATCH] splash: Cleaned up code --- FireWallet/SplashScreen.cs | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/FireWallet/SplashScreen.cs b/FireWallet/SplashScreen.cs index a3854ac..28f9b23 100644 --- a/FireWallet/SplashScreen.cs +++ b/FireWallet/SplashScreen.cs @@ -1,6 +1,5 @@ using System.Diagnostics; using System.Drawing.Imaging; -//using Microsoft.DirectX.AudioVideoPlayback; namespace FireWallet @@ -14,6 +13,7 @@ namespace FireWallet IsClosed = false; } bool close; + float opacity = 0.0f; private void SplashScreen_FormClosing(object sender, FormClosingEventArgs e) { if (!close) @@ -30,7 +30,6 @@ namespace FireWallet timerIn.Stop(); timerOut.Start(); } - private void label2_Click(object sender, EventArgs e) { ProcessStartInfo psi = new ProcessStartInfo @@ -51,38 +50,22 @@ namespace FireWallet { try { - //create a Bitmap the size of the image provided Bitmap bmp = new Bitmap(image.Width, image.Height); - - //create a graphics object from the image using (Graphics gfx = Graphics.FromImage(bmp)) { - - //create a color matrix object ColorMatrix matrix = new ColorMatrix(); - - //set the opacity matrix.Matrix33 = opacity; - - //create image attributes ImageAttributes attributes = new ImageAttributes(); - - //set the color(opacity) of the image attributes.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); - - //now draw the image gfx.DrawImage(image, new Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attributes); } return bmp; } - catch (Exception ex) + catch { - MessageBox.Show(ex.Message); return null; } } - float opacity = 0.0f; - private void timerIn_Tick(object sender, EventArgs e) { if (opacity >= 1) @@ -94,7 +77,6 @@ namespace FireWallet pictureBoxNew.Image = SetImageOpacity(splash, opacity); pictureBoxNew.Invalidate(); } - private void timerOut_Tick(object sender, EventArgs e) { if (opacity <= 0)