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
追问
如何创建运行该程序的按钮。。(老师让自学。。桑心了)
追答
左侧工具箱里有按钮和图片框等控件,双击按钮控件即可添加到窗体上,图片框同理,添加图片框后右击复制,在窗体的空白处粘贴三下,控件的位置和大小可以用鼠标调整.写完回答我忽然也很桑心
墨刀Modao
2024-12-06 广告
2024-12-06 广告
在制作原型图时,可以选择多种软件工具来满足不同的需求和偏好。以下是一些常见的原型图软件:墨刀 :是一款在线原型设计工具,界面友好,易于上手,适合产品经理快速创建移动应用和网页的低保真原型。其协作功能便于团队实时共享设计和反馈。Sketch ...
点击进入详情页
本回答由墨刀Modao提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询