new splash screen logo file (with transparency), new splash screen drawing method
This commit is contained in:
1 parent
bd36b3d1d4
commit
848f5b62aa
2 files changed
+16
-3
No files matched your search
Binary file not shown.
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 65 KiB |
+16
-3
@@ -192,6 +192,8 @@ namespace Vocaluxe
|
|||||||
|
|
||||||
class SplashScreen : Form
|
class SplashScreen : Form
|
||||||
{
|
{
|
||||||
|
Bitmap logo;
|
||||||
|
|
||||||
public SplashScreen()
|
public SplashScreen()
|
||||||
{
|
{
|
||||||
string path = Path.Combine(Environment.CurrentDirectory, Path.Combine(CSettings.sFolderGraphics, CSettings.sLogo));
|
string path = Path.Combine(Environment.CurrentDirectory, Path.Combine(CSettings.sFolderGraphics, CSettings.sLogo));
|
||||||
@@ -199,9 +201,8 @@ namespace Vocaluxe
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Bitmap logo = new Bitmap(path);
|
logo = new Bitmap(path);
|
||||||
this.ClientSize = new Size(logo.Width, logo.Height);
|
this.ClientSize = new Size(logo.Width, logo.Height);
|
||||||
this.BackgroundImage = logo;
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -230,8 +231,20 @@ namespace Vocaluxe
|
|||||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||||
this.Text = CSettings.sProgramName;
|
this.Text = CSettings.sProgramName;
|
||||||
this.CenterToScreen();
|
this.CenterToScreen();
|
||||||
this.TransparencyKey = this.BackColor; //thx to Klafhor :>
|
|
||||||
this.Show();
|
this.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs e)
|
||||||
|
{
|
||||||
|
if (logo == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Graphics g = e.Graphics;
|
||||||
|
g.DrawImage(logo, new Rectangle(0, 0, this.Width, this.Height));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user