大家帮帮忙,谢谢 关于image

no111 2004-10-21 06:42:57
我想做一个图片任意放大的程序,当点击command1,picture1中的image1就放大,我便了一下程序,大家帮忙看看怎吗不行???

Option Explicit
Dim dscale As Integer
Dim widscale As Integer
Dim heiscale As Integer
Dim topscale As Integer
Dim leftscale As Integer

Private Sub Command1_Click()
dscale = 500
widscale = Image1.Width + dscale * 2
heiscale = Image1.Height + dscale * 2
topscale = Image1.Top - dscale
lefscale = Image1.Left - dscale
Image1.Move lefscale, topscale, widscale, heiscale
End Sub

Private Sub Form_Load()
Image1.Picture = LoadPicture("c:\bmp\bb.bmp")
x = Picture1.Width / 2
y = Picture1.Height / 2
Image1.Left = x - Image1.Width / 2
Image1.Top = y - Image1.Height / 2
Form1.WindowState = vbMaximized
End Sub

是不是我加载的图片格式不对?
...全文
131 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
northwolves 2004-10-21
  • 打赏
  • 举报
回复
设置Image1.stretch=True就可以了

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧