c# 窗体重画,形状自定义
2011-08-11 20:35
295 查看
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Case01_6 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } public Bitmap mybit; private void Form1_Load(object sender, EventArgs e) { mybit = new Bitmap("bai.png"); mybit.MakeTransparent(Color.White); this.StartPosition = FormStartPosition.CenterScreen; this.WindowState = FormWindowState.Normal ; } protected override void OnPaint(PaintEventArgs e)//方法重写 { e.Graphics.DrawImage((Image)mybit, new Point(0, 0)); //将图像画出 } private void Form1_Click_1(object sender, EventArgs e) { //Application.Exit(); } } }
效果图: 原窗体
重画窗体 白色全部过滤掉了
相关文章推荐
- 【转】C#自定义控件:WinForm将其它应用程序窗体嵌入自己内部
- C# WinForm窗体自定义功能快捷键
- c# 自定义控件透明,自定义透明窗体
- paip.c#.net自定义图像窗体form
- 使用C#创建自定义背景色/形状的菜单栏与工具栏
- 画出各种自定义的窗体形状
- 自定义形状窗体
- 教你创建自定义形状的窗体
- <转载>C# 通过API改变窗体形状
- 创建自定义形状的窗体和控件
- 向C#的选项卡中添加自定义窗体
- 自定义形状窗体
- Qt---自定义对话框形状、移动窗体
- c# 实现自定义窗体 加简单换肤
- C#使用Setting保存用户自定义窗体位置
- 在.net(C# or vb.net)中如何用户自定义消息,并在窗体中处理这些消息
- 自定义WPF窗体形状
- C# WinForm自定义拖动窗体
- C# 窗体的最大化、最小化、关闭按钮的自定义
- C# 实现自定义处理窗体按键(整理)