如何获取图片的长和宽
如何获取图片的长和宽以像素为单位
Option Explicit Private Sub Form_Load() Dim picTemp As StdPicture Set picTemp = LoadPicture(Environ$("SystemRoot") & "\system32\setup.bmp") Me.Picture = picTemp Debug.Print Me.ScaleX(picTemp.Width, ScaleModeConstants.vbHimetric, ScaleModeConstants.vbPixels) Debug.Print Me.ScaleY(picTemp.Height, ScaleModeConstants.vbHimetric, ScaleModeConstants.vbPixels) Me.Top = 0 Me.Left = 0 '有边框和标题栏在 Me.Width = Me.ScaleX(picTemp.Width, ScaleModeConstants.vbHimetric, ScaleModeConstants.vbTwips) Me.Height = Me.ScaleX(picTemp.Height, ScaleModeConstants.vbHimetric, ScaleModeConstants.vbTwips) End Sub