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(Imagetemp=LayeredSkin.ImageEffects.RotateImage(yezi,angle,newPoint(25,3)))      {        g.DrawImage(temp,140,70);//绘制叶子      }      base.OnLayeredPaint(e);    }    privatevoidtimer1_Tick(objectsender,EventArgse)    {      LayeredPaint();      GC.Collect();    }    publicboolisShow=false;    boolisFirst=true;    privatevoidlayeredButton3_Click(objectsender,EventArgse)    {      isShow=false;      if(isFirst)      {        this.Animation.Effect=newLayeredSkin.Animations.ThreeDTurn();        this.Animation.AnimationEnd=Animation_AnimationEnd;      }      isFirst=false;      this.Animation.Asc=false;      this.Animation.Start();    }    //QQConfigconfig;    voidAnimation_AnimationEnd(objectsender,LayeredSkin.Animations.AnimationEventArgse)    {      if(!isShow)      {        this.Hide();        QQConfigconfig=newQQConfig(this);        config.Location=this.Location;        config.Show();      }    }  }}-IMDN开发者社群-imdn.cn"> 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(Imagetemp=LayeredSkin.ImageEffects.RotateImage(yezi,angle,newPoint(25,3)))      {        g.DrawImage(temp,140,70);//绘制叶子      }      base.OnLayeredPaint(e);    }    privatevoidtimer1_Tick(objectsender,EventArgse)    {      LayeredPaint();      GC.Collect();    }    publicboolisShow=false;    boolisFirst=true;    privatevoidlayeredButton3_Click(objectsender,EventArgse)    {      isShow=false;      if(isFirst)      {        this.Animation.Effect=newLayeredSkin.Animations.ThreeDTurn();        this.Animation.AnimationEnd=Animation_AnimationEnd;      }      isFirst=false;      this.Animation.Asc=false;      this.Animation.Start();    }    //QQConfigconfig;    voidAnimation_AnimationEnd(objectsender,LayeredSkin.Animations.AnimationEventArgse)    {      if(!isShow)      {        this.Hide();        QQConfigconfig=newQQConfig(this);        config.Location=this.Location;        config.Show();      }    }  }} - IMDN开发者社群-imdn.cn">
登录
首页 » C# » c# winform 自定义控件类LayeredSkin.dll

c# winform 自定义控件类LayeredSkin.dll

于 2020-12-11 发布
0 335
下载积分: 1 下载次数: 1

代码说明:

自定义开关按钮,滚动相册,进度条,窗体控件/******************************************************************** * * * * 使本项目源码或本项目生成的DLL前请仔细阅读以下协议内容,如果你同意以下协议才能使用本项目所有的功能, * * 否则如果你违反了以下协议,有可能陷入法律纠纷和赔偿,作者保留追究法律责任的权利。 * * * * 1、你可以在开发的软件产品中使用和修改本项目的源码和DLL,但是请保留所有相关的版权信息。 * * 2、不能将本项目源码与作者的其他项目整合作为一个单独的软件售卖给他人使用。 * * 3、不能传播本项目的源码和DLL,包括上传到网上、拷贝给他人等方式。 * * 4、以上协议暂时定制,由于还不完善,作者保留以后修改协议的权利。 * * * * Copyright (C) 2013-2014 LayeredSkin Corporation All rights reserved. * * 作者: 小红帽  QQ:761716178 * * 请保留以上版权信息,否则作者将保留追究法律责任。 * * * * 创建时间:2014-04-13 * * 说明:QQ.cs * *********************************************************************/using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using LayeredSkin.Forms;namespace test{    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)        {            this.Animation.Effect = new LayeredSkin.Animations.GradualCurtainEffect() { ChangeHeight = 25 };            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.Animation.Effect = new LayeredSkin.Animations.GradualCurtainEffect();            this.Animation.Asc = true;            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(PaintEventArgs 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 bool isShow = false;        bool isFirst = true;        private void layeredButton3_Click(object sender, EventArgs e)        {            isShow = false;            if (isFirst)            {                this.Animation.Effect = new LayeredSkin.Animations.ThreeDTurn();                this.Animation.AnimationEnd = Animation_AnimationEnd;            }            isFirst = false;            this.Animation.Asc = false;            this.Animation.Start();        }        //QQConfig config;        void Animation_AnimationEnd(object sender, LayeredSkin.Animations.AnimationEventArgs e)        {            if (!isShow)            {                this.Hide();                QQConfig config = new QQConfig(this);                config.Location = this.Location;                config.Show();            }        }    }}

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • C#_教程笔记(传智播客)-苏坤.docx
    C#_基础教程笔记(传智播客)-苏坤.docx
    2020-12-01下载
    积分:1
  • C# 验证邮箱是否真实存在的源码 不是验证邮箱格式
    C# 验证邮箱是否真实存在的源码 不是验证邮箱格式
    2013-11-28下载
    积分:1
  • C# 图片显示器
    【实例简介】可以设置图片播放等待时间
    2021-11-30 00:45:45下载
    积分:1
  • DCOM授权
    DCOM授权
    2014-03-11下载
    积分:1
  • C# 代码相似度计算 例子源码下载
    文本相似度计算
    2014-10-19下载
    积分:1
  • 收银系统(源码+数据库)
    【实例简介】世纪华联超市-收银系统源码
    2021-10-11 00:31:03下载
    积分:1
  • 北大青鸟课件-使用ASP.NET构建动态网站(附实例源码)
    北大青鸟课件-使用ASP.NET构建动态网站(附实例源码)
    2015-11-09下载
    积分:1
  • 动画效果浮动窗体实例
            private void StopRectTimer_Tick(object sender, EventArgs e)        {            //如果鼠标在窗体上,则根据停靠位置显示整个窗体              if (this.Bounds.Contains(Cursor.Position))            {                switch (this.StopDock)                {                    case AnchorStyles.Top:                        this.Location = new Point(this.Location.X, 0);                        break;                    case AnchorStyles.Bottom:                        this.Location = new Point(this.Location.X, Screen.PrimaryScreen.Bounds.Height - this.Height);                        break;                    case AnchorStyles.Left:                        this.Location = new Point(0, this.Location.Y);                        break;                    case AnchorStyles.Right:                        this.Location = new Point(Screen.PrimaryScreen.Bounds.Width - this.Width, this.Location.Y);                        break;                }            }            else  //如果鼠标离开窗体,则根据停靠位置隐藏窗体,但须留出部分窗体边缘以便鼠标选中窗体              {                switch (this.StopDock)                {                    case AnchorStyles.Top:                        this.Location = new Point(this.Location.X, (this.Height - 3) * (-1));                        break;                    case AnchorStyles.Bottom:                        this.Location = new Point(this.Location.X, Screen.PrimaryScreen.Bounds.Height - 5);                        break;                    case AnchorStyles.Left:                        this.Location = new Point((-1) * (this.Width - 3), this.Location.Y);                        break;                    case AnchorStyles.Right:                        this.Location = new Point(Screen.PrimaryScreen.Bounds.Width - 2, this.Location.Y);                        break;                }            }        }
    2015-06-10下载
    积分:1
  • C# 下载图片示例
    using System;using System.Web;public class DownImg : IHttpHandler { //图片下载功能 public void ProcessRequest(HttpContext context) { System.Net.WebResponse response = null; System.IO.Stream stream = null; string path = context.Request.Url.Query.Split(new string[] { "coverimg=" }, StringSplitOptions.RemoveEmptyEntries)[1]; System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(path); response = request.GetResponse(); stream = response.GetResponseStream(); System.IO.MemoryStream memStream = Txooo.Mobile.HttpTools.CloneStream(stream); byte[] bytes = new byte[memStream.Length]; memStream.Read(bytes, 0, bytes.Length); // 设置当前流的位置为流的开始 memStream.Seek(0, System.IO.SeekOrigin.Begin); context.Response.ContentType = "application/octet-stream"; //通知浏览器下载文件而不是打开 string fileName = DateTime.Now.Ticks.ToString() ".jpg"; context.Response.AddHeader("Content-Disposition", "attachment; filename=" fileName); context.Response.BinaryWrite(bytes); context.Response.Flush(); } public bool IsReusable { get { return false; } }}
    2014-05-29下载
    积分:1
  • C#对Mysql数据库增删改查(ADO.NET 非EFcore)
    【实例简介】封装了c#对MySQL增删改查的操作
    2021-11-22 00:42:44下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载