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 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询