Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB6: Getting image size in pixels

Tags:

vb6

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, the 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?

like image 519
ezpresso Avatar asked May 26 '11 18:05

ezpresso


1 Answers

They are in himetrics.

Use

With View1
  MsgBox .ScaleX(.Picture.Width, vbHimetric, vbPixels)
  MsgBox .ScaleY(.Picture.Height, vbHimetric, vbPixels)
End With
like image 125
GSerg Avatar answered Oct 27 '22 21:10

GSerg