加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

VB Picture不能显示全部图片怎么办?

发布时间:2020-12-17 08:15:13 所属栏目:百科 来源:网络整理
导读:界面固定后,picture不能显示全部图片,怎么办? 两个方法: 1、在picture中再加入一个image,调整大小与picture一样,将image的stretch的属性设置为真. 这样图片在image的强制下,正好与picture一样大。 2、同样在picture中加入image,但把stretch设置为假。


界面固定后,picture不能显示全部图片,怎么办?

两个方法:

1、在picture中再加入一个image,调整大小与picture一样,将image的stretch的属性设置为真.

这样图片在image的强制下,正好与picture一样大。

2、同样在picture中加入image,但把stretch设置为假。即原样图。移动image可以在picture中看到原样。

这样图像不会失真。


看下第二个方法:



Option Explicit
Dim oldX As Long
Dim oldY As Long

Private Sub Form_Load()
    Image1.Picture = LoadPicture("D:1.jpg")
End Sub

Private Sub Image1_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single)

    If Button = vbKeyLButton Then
        oldX = X
        oldY = Y
        Me.MousePointer = 2
    End If
End Sub

Private Sub Image1_MouseMove(Button As Integer,Y As Single)

    If Button = vbKeyLButton Then
        Image1.Left = Image1.Left + (X - oldX)
        Image1.Top = Image1.Top + (Y - oldY)
    End If
End Sub

Private Sub Image1_MouseUp(Button As Integer,Y As Single)

    If Button = vbKeyLButton Then
        Me.MousePointer = 0
    End If
End Sub

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读