2个回答
展开全部
'窗体上两个按钮,四个图片框,图片框设置成数组,图片框(0)加载图片,用下面的示例代码
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
'按钮1,旋转
Private Sub Command1_Click()
With Picture1.Item(0) '加载图片
.Picture = LoadPicture("图片地址")
End With
With Picture1.Item(1) '90度
.PaintPicture Picture1.Item(0).Picture, 0, 0, .ScaleWidth, .ScaleHeight, .ScaleWidth, 0, -.ScaleWidth, .ScaleHeight
End With
With Picture1.Item(2) '镜像
.PaintPicture Picture1.Item(0).Picture, 0, 0, .ScaleWidth, .ScaleHeight, 0, .ScaleHeight, .ScaleWidth, -.ScaleHeight
End With
With Picture1.Item(3) '180度
.PaintPicture Picture1.Item(0).Picture, 0, 0, .ScaleWidth, .ScaleHeight, .ScaleWidth, .ScaleHeight, -.ScaleWidth, -.ScaleHeight
End With
End Sub
'按钮2,改变墙纸
Private Sub Command2_Click()
Dim ChangeWP
ChangeWP = SystemParametersInfo(20, 0, "图片地址", 0)
End Sub
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
'按钮1,旋转
Private Sub Command1_Click()
With Picture1.Item(0) '加载图片
.Picture = LoadPicture("图片地址")
End With
With Picture1.Item(1) '90度
.PaintPicture Picture1.Item(0).Picture, 0, 0, .ScaleWidth, .ScaleHeight, .ScaleWidth, 0, -.ScaleWidth, .ScaleHeight
End With
With Picture1.Item(2) '镜像
.PaintPicture Picture1.Item(0).Picture, 0, 0, .ScaleWidth, .ScaleHeight, 0, .ScaleHeight, .ScaleWidth, -.ScaleHeight
End With
With Picture1.Item(3) '180度
.PaintPicture Picture1.Item(0).Picture, 0, 0, .ScaleWidth, .ScaleHeight, .ScaleWidth, .ScaleHeight, -.ScaleWidth, -.ScaleHeight
End With
End Sub
'按钮2,改变墙纸
Private Sub Command2_Click()
Dim ChangeWP
ChangeWP = SystemParametersInfo(20, 0, "图片地址", 0)
End Sub
追问
如何创建运行该程序的按钮。。(老师让自学。。桑心了)
追答
左侧工具箱里有按钮和图片框等控件,双击按钮控件即可添加到窗体上,图片框同理,添加图片框后右击复制,在窗体的空白处粘贴三下,控件的位置和大小可以用鼠标调整.写完回答我忽然也很桑心
博思aippt
2024-07-20 广告
2024-07-20 广告
**AI一键生成PPT免费版**为满足广大用户的需求,我们博思云创科技特推出AI一键生成PPT免费版。用户只需简单输入需求,AI技术便能智能分析并快速生成高质量PPT。此版本功能强大且易于操作,无需专业设计技能,即可轻松打造出令人满意的演示...
点击进入详情页
本回答由博思aippt提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询