資源簡介
public partial class QQ : LayeredForm
{
public QQ()
{
InitializeComponent();
}
private void layeredButton1_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Minimized;
}
private void QQ_Load(object sender, EventArgs e)
{
yezi = new Bitmap(90, 80);//先把葉子畫在稍微大一點的畫布上,這樣葉子旋轉的時候才不會被裁掉一部分
using (Graphics g = Graphics.FromImage(yezi))
{
g.DrawImage(Image.FromFile("Images\\yezi3.png"), 10, 0);
}
timer1.Start();
}
private void layeredButton2_Click(object sender, EventArgs e)
{
this.Close();
}
private void FormMoveMouseDown(object sender, MouseEventArgs e)
{
LayeredSkin.NativeMethods.MouseToMoveControl(this.Handle);
}
Image Cloud = Image.FromFile("Images\\cloud.png");
float cloudX = 0;
Image yezi;
float angle = 10;
bool RotationDirection = true;//是否為順時針
protected override void OnLayeredPaint(LayeredSkin.LayeredEventArgs e)
{
Graphics g = e.Graphics;
if (cloudX > this.Width - Cloud.Width)
{//云的飄動
cloudX = 0;
}
else
{
cloudX = 0.5f;
}
g.DrawImage(Cloud, cloudX, 0);//把云繪制上去
if (angle > 10)
{//控制旋轉方向
RotationDirection = false;
}
if (angle < -10)
{
RotationDirection = true;
}
if (RotationDirection)
{
angle = 1;
}
else
{
angle -= 1;
}
using (Image temp = LayeredSkin.ImageEffects.RotateImage(yezi, angle, new Point(25, 3)))
{
g.DrawImage(temp, 140, 70);//繪制葉子
}
base.OnLayeredPaint(e);
}
private void timer1_Tick(object sender, EventArgs e)
{
LayeredPaint();
GC.Collect();
}
}
public partial class Kugou : LayeredForm
{
public Kugou()
{
InitializeComponent();
path.AddLine(new Point(105, 0), new Point(205, 102));
path.AddLine(new Point(205, 102), new Point(105, 200));
path.AddLine(new Point(105, 200), new Point(0, 102));
path.AddLine(new Point(0, 102), new Point(105, 0));
path.CloseFigure();
}
private void MouseDownFormMove(object sender, MouseEventArgs e)
{
NativeMethods.MouseToMoveControl(this.Handle);
}
float opacity = 1;
GraphicsPath path = new GraphicsPath();
bool isFadeIn = false;
/// <summary>
/// 用于檢測鼠標是否移入界面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void timer1_Tick(object sender, EventArgs e)
{
Point mousePoint = Control.MousePosition;
mousePoint.Offset(-this.Location.X, -this.Location.Y);
if (path.IsVisible(mousePoint) != isFadeIn)
{
isFadeIn = !isFadeIn;
if (isFadeIn)
{
timer2.Start();
}
else
{
timer3.Start();
}
}
}
/// <summary>
/// 實現淡入淡出效果
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void timer2_Tick(object sender, EventArgs e)
{
if (isFadeIn)
{
if (opacity <= 1)
{
opacity = 0.06f;
}
if (opacity > 1)
{
opacity = 1;
timer2.Stop();
}
}
else
{
if (opacity >= 0)
{
opacity -= 0.06f;
}
if (opacity < 0)
{
opacity = 0;
timer2.Stop();
}
}
layeredPanel1.ImageAttribute = ImageEffects.ChangeOpacity(opacity);
LayeredPaint();
}
/// <summary>
/// 用于鼠標移出后延遲執行淡出效果
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void timer3_Tick(object sender, EventArgs e)
{
timer3.Stop();
timer2.Start();
}
}
代碼片段和文件信息
/********************************************************************
?*?*
?*?*?使本項目源碼或本項目生成的DLL前請仔細閱讀以下協議內容,如果你同意以下協議才能使用本項目所有的功能,
?*?*?否則如果你違反了以下協議,有可能陷入法律糾紛和賠償,作者保留追究法律責任的權利。
?*?*
?*?*?1、你可以在開發的軟件產品中使用和修改本項目的源碼和DLL,但是請保留所有相關的版權信息。
?*?*?2、不能將本項目源碼與作者的其他項目整合作為一個單獨的軟件售賣給他人使用。
?*?*?3、不能傳播本項目的源碼和DLL,包括上傳到網上、拷貝給他人等方式。
?*?*?4、以上協議暫時定制,由于還不完善,作者保留以后修改協議的權利。
?*?*
?*?*?Copyright?(C)?2013-2014?layeredSkin?Corporation?All?rights?reserved.
?*?*?作者:?小紅帽??QQ:761716178
?*?*?請保留以上版權信息,否則作者將保留追究法律責任。
?*?*
?*?*?創建時間:2014-04-13
?*?*?說明:Form2.cs
?*?*
********************************************************************/
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Drawing.Drawing2D;
using?System.Text
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3115??2012-11-20?11:13??類似QQ登入\bin\Debug\Images\close0.png
?????文件???????3509??2012-11-20?11:13??類似QQ登入\bin\Debug\Images\close1.png
?????文件??????17373??2012-11-20?11:13??類似QQ登入\bin\Debug\Images\cloud.png
?????文件???????6918??2012-11-20?11:13??類似QQ登入\bin\Debug\Images\loginbody.png
?????文件?????289422??2012-11-20?11:13??類似QQ登入\bin\Debug\Images\logo32.ico
?????文件???????2922??2012-11-20?11:13??類似QQ登入\bin\Debug\Images\mini0.png
?????文件???????3066??2012-11-20?11:13??類似QQ登入\bin\Debug\Images\mini1.png
?????文件???????9286??2012-11-20?11:13??類似QQ登入\bin\Debug\Images\sun2.png
?????文件??????46087??2012-11-20?11:13??類似QQ登入\bin\Debug\Images\yezi2.png
?????文件???????9975??2012-11-20?11:13??類似QQ登入\bin\Debug\Images\yezi3.png
?????文件?????269312??2014-04-14?15:22??類似QQ登入\bin\Debug\la
?????文件?????306688??2014-04-14?15:20??類似QQ登入\bin\Debug\la
?????文件????1214976??2014-04-14?16:34??類似QQ登入\bin\Debug\test.exe
?????文件??????67072??2014-04-14?16:34??類似QQ登入\bin\Debug\test.pdb
?????文件??????22704??2014-04-14?16:34??類似QQ登入\bin\Debug\test.vshost.exe
?????文件????????490??2010-03-17?22:39??類似QQ登入\bin\Debug\test.vshost.exe.manifest
?????文件???????3562??2014-04-14?15:03??類似QQ登入\Form2.cs
?????文件???????6252??2014-04-14?15:03??類似QQ登入\Form2.Designer.cs
?????文件?????386085??2014-04-14?14:45??類似QQ登入\Form2.resx
?????文件???????4166??2014-04-14?15:03??類似QQ登入\Kugou.cs
?????文件??????28025??2014-04-14?15:03??類似QQ登入\Kugou.Designer.cs
?????文件?????154743??2014-04-10?22:07??類似QQ登入\Kugou.resx
?????文件??????12223??2014-04-14?15:49??類似QQ登入\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????6201??2014-04-14?15:49??類似QQ登入\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件???????2549??2014-04-14?16:34??類似QQ登入\obj\Debug\test.csproj.FileListAbsolute.txt
?????文件???????1023??2014-04-14?14:45??類似QQ登入\obj\Debug\test.csproj.GenerateResource.Cache
?????文件??????11639??2014-04-14?15:49??類似QQ登入\obj\Debug\test.csprojResolveAssemblyReference.cache
?????文件????1214976??2014-04-14?16:34??類似QQ登入\obj\Debug\test.exe
?????文件?????254283??2014-04-14?15:50??類似QQ登入\obj\Debug\test.Form2.resources
?????文件?????104592??2014-04-14?15:50??類似QQ登入\obj\Debug\test.Kugou.resources
............此處省略30個文件信息
- 上一篇:c#隊列編程(Queue)
- 下一篇:OA辦公管理系統源碼(附數據庫)
評論
共有 條評論