mirror of
https://github.com/Nathanwoodburn/FireWallet.git
synced 2024-12-25 15:28:15 +11:00
splash: Cleaned up code
This commit is contained in:
parent
9f0f7214e2
commit
a4a35ad62e
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user