1. 在表单上添加一个图片控件 image1
2. 在 image1.Init 设置其属性
this.Move(0,0)
&& 将图片移至左上角
this.Stretch=2
&& 图片变比缩放
this.ZOrder(1)
&& 将图片控件置于最底层,使其作为背景
this.Picture="d:\yj.jpg"
&& 设置图片文件
this.Width=thisform.Width
&& 设置图片与表单同宽
this.Height=thisform.height && 设置图片与表单同高
3. 在表单的 Resize 事件中输入以下代码:
* 图片随窗口缩放
this.image1.width = this.width
this.image1.height = this.height