VB6.0怎么把主程序背景图片跟系统分辨率配合?
来源:百度知道 编辑:UC知道 时间:2024/06/07 19:04:14
还有回答这个问题外加提供VB6.0好点的比较绿色的皮肤工具(除了activeskin,CoolBoySkin)的我外加50分
2楼:我说的是form的背景图片,不是控件(不是picture box,也不是image box)
3楼,你说的我也会做,但是实现随系统分辨率变的具体方法或代码?
参考一下我以前写的代码,至于为什么一定要有一个picturebox,因为只有它有DC(除了窗体本身)
Public Sub Paint() '用来实现窗体图案的平铺,由此可以类推出拉伸,镜象等特效
Dim pich, picw As Integer
Dim i, j As Variant
Dim x As Long
form1.Picture1.Picture = LoadPicture("")
pich = form1.P2.ScaleHeight
picw = form1.P2.ScaleWidth
For i = 0 To frm1.Picture1.ScaleHeight / form1.P2.ScaleHeight
For j = 0 To frm1.Picture1.ScaleWidth / form1.P2.ScaleWidth
x = BitBlt(form1.Picture1.hDC, j * picw, i * pich, picw, pich, form1.P2.hDC, 0, 0, SRCCOPY)
Next
Next
End Sub
这个比较高难度 我不会
你是用的picture控件把。你应该使用image控件,并且将stretch控件属性该为true.这样就没有问题了。
form那里有autosize属性呀。
你用在form上加个image控件,然后stretch控件属性该为true
只能间接实现,即用image控件作form背景。
当form大小变化时,让image的高左顶宽与其一致,并设image的stretch属性为true。
建议使用P