设置了winform的背景图片随窗体的变化而变化
来源:互联网 发布:遂宁知秋凤凰婚庆 编辑:程序博客网 时间:2024/05/16 06:57
private
void
mainform_Paint(
object
sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
System.Drawing.Bitmap xzfy =
new
System.Drawing.Bitmap(Application.StartupPath +
"//img/背景.png"
);
g.DrawImage(xzfy,
this
.ClientRectangle);
}
private
void
loadBackImage()
{
Bitmap bit =
new
Bitmap(
this
.Width,
this
.Height);
Graphics g = Graphics.FromImage(bit);
// g.DrawImage(this.pictureBox1.Image, new Rectangle(0, 0, bit.Width, bit.Height), 0, 0, this.pictureBox1.Image.Width, this.pictureBox1.Image.Height, GraphicsUnit.Pixel);
this
.BackgroundImage = bit;
g.Dispose();
}
private
void
mainform_SizeChanged(
object
sender, EventArgs e)
{
loadBackImage();
}
private
void
mainform_Load(
object
sender, EventArgs e)
{
loadBackImage();
}
http://www.cnblogs.com/shuang121/p/3150047.html
0 0
- 设置了winform的背景图片随窗体的变化而变化
- winform 控件随窗体的变化而变化
- 背景图片随网页的变化而变化(指大小)
- 如何让控件随窗体的大小变化而变化
- VB 背景图片随窗体变化
- 使窗体内的控件高度随窗体尺寸变化而变化
- C#窗体控件大小随窗体变化而变化的一种改进方法
- 空间随着窗体变化而变化的示例
- Winform 控件随窗体大小改变而变化
- Winform 控件随窗体大小改变而变化
- 让TextBox随窗体变化而变化
- MFC中让控件随窗体大小变化而变化中需要注意的问题
- C#使控件随窗体变化而变化的两种方法
- 窗体控件大小随窗体大小变化而变化
- 窗体控件大小随窗体大小变化而变化
- VB窗体控件大小随窗体大小变化而变化
- 窗体随着另外一个窗体的变化而变化 的解决办法
- 【NCRE】——Winform窗体控件随窗体大小而变化
- IHEOS
- iOS Code Signing Troubleshooting
- Java读取src目录下的properties配置文件
- Initalizing 'AppDelegate * __strong' with an expression of incompatible type ''id<UIApplicatioinDele
- linux端口重用
- 设置了winform的背景图片随窗体的变化而变化
- 携一片阳光前行
- 笔记-编译器选项之预编译头
- 在控制台下显示进度
- 谈谈观察者模式
- VBScript使用window.open打开新窗口
- Objective-C代码规范
- Java打印菱形图
- PB Send()函数应用有关数据整理