I put a picture box on a form and loaded some picture on it:
View1.Picture = LoadPicture(App.Path & "\sample2.bmp")
When I tried to get the width and height of the Picture property, th开发者_StackOverflow社区e values I received are not in pixels nor twips. Does anybody knows how to determine the size of an image in pixels in Visual Basic 6?
They are in himetrics.
Use
With View1
MsgBox .ScaleX(.Picture.Width, vbHimetric, vbPixels)
MsgBox .ScaleY(.Picture.Height, vbHimetric, vbPixels)
End With
精彩评论