欢迎光临
我们一直在努力

如何制作winform得启动画面_asp.net技巧

建站超值云服务器,限时71元/月

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;


namespace SlashScreenLib
{
    public class SlashScreenForm:Form
    {
        static SlashScreenForm slashScreen;
        Bitmap bitMap;
        public static SlashScreenForm SlashScreen
        {
            get
            {
                if (slashScreen == null)
                {
                    slashScreen = new SlashScreenForm();
                }
                return slashScreen;
            }
        }
 
        public SlashScreenForm()
        {
            //SlashScreen肯定显示在屏幕中央
            this.StartPosition = FormStartPosition.CenterScreen;
            //应该没有边框
            this.FormBorderStyle = FormBorderStyle.None;
            //获取SlashScreen要显示的图片
            bitMap = Resources.Resource.SlashScreen;
            //窗口大小与图片大小一致
            this.ClientSize = bitMap.Size;
            //在图片上写上字
            using (Font f = new Font(“宋体”, 18))
            {
                using (Graphics g = Graphics.FromImage(bitMap))
                {
                    g.DrawString(“Jillzhang”, f, Brushes.Black, 100, 142);
                }
            }
            this.BackgroundImage = bitMap;
        }
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
            if (disposing)
            {
                if (bitMap != null)
                {
                    bitMap.Dispose();
                    bitMap = null;
                }
            }
        }
    }
}

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 如何制作winform得启动画面_asp.net技巧
分享到: 更多 (0)