开发者

VB6: Getting image size in pixels

开发者 https://www.devze.com 2023-03-08 10:46 出处:网络
I put a picture box on a form and loaded some picture on it: View1.Picture = LoadPicture(App.Path & \"\\sample2.bmp\")

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
0

精彩评论

暂无评论...
验证码 换一张
取 消