好的所以我创建了一个程序,不是一个程序,而是某种带有动画的全屏形式(带有图片框)......
问题是,我做了1366x768屏幕分辨率的“程序”,当我试图在我的另一个桌面(1024x768)上运行那个“程序”时,它是,不好,所以我只是想知道是可以根据屏幕分辨率编写调整picbox位置的代码......
我尝试使用此代码
Dim ScrWidth As Integer = Screen.PrimaryScreen.Bounds.Width
Dim ScrHeight As Integer = Screen.PrimaryScreen.Bounds.Height
然后我使用了scrwidth和scrheight但我没有做任何事情......
答案 0 :(得分:0)
由于你没有提到它,我不确定你使用scrwidth和scrheight做了什么,但这是你调整图片框大小的方法:
pictureBox1.Size = New Size(Width, Height)
当然你需要自己考虑宽高比。它不会为你做。
,如(伪代码):
ratio = current_width/current_height
new_width = whatever
new_height = whatever/ratio