vb中,Picture1.Width 和 Picture1.,VB中的width和scalewidth,关于图片的缩放

发布时间:2020-07-09 18:33:56

vb中,Picture1.Width 和 Picture1.,VB中的width和scalewidth,关于图片的缩放

网友回答

Width与Height就是控件外在的宽度和高度,是外在坐标系里的宽度和高度。
  ScaleWidth,ScaleHeight是控件内部坐标的宽度和高度。

网友回答

'原因,img1的高和宽已被你该变
  Private Sub optHeight_Click()
   Img1.Width = Img1.Picture.Width * Pic1.ScaleHeight / Img1.Picture.Height
   Img1.Height = Pic1.ScaleHeight
   Img1.Stretch = True
  End Sub
  '适应宽度
  Private Sub optWidth_Click()
   Img1.Height = Img1.Picture.Height * Pic1.ScaleWidth / Img1.Picture.Width
   Img1.Width = Pic1.ScaleWidth
   Img1.Stretch = True
  End Sub
  '拉伸
  Private Sub OptStretch_Click()
   Img1.Height = Pic1.Height
   Img1.Width = Pic1.Width
   Img1.Stretch = True
  End Sub
  '实际大小
  Private Sub optReal_Click()
   Img1.Stretch = False
   Img1.Width = Img1.Picture.Width
   Img1.Height = Img1.Picture.Height
  End Sub
以上问题属网友观点,不代表本站立场,仅供参考!