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-09-19 广告
2024-09-19 广告
作为北京饼干科技有限公司的工作人员,关于AIPPT免费生成PPT的功能,我可以简要介绍如下:AIPPT是一款基于人工智能技术的PPT制作工具,它为用户提供了免费生成PPT的便捷服务。用户只需简单输入PPT的主题或内容大纲,AIPPT便能智能...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询