Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding Image Size

Status
Not open for further replies.

MALICKA

Programmer
Oct 16, 2002
46
0
0
HK
1)I have to show Some imgaes On VB form
Images or stored on different folder ( size is not standard)
How to determine the size of the image
i have created box of 640x480
but images of bigger size shown in distored form.
HOw can i resize all the picture while shown in the form.

2)How to resize the font in datagrid(when user Increase or Decrease the grid font size shoule be increased or decreased accordingly)

-Mal
 

This can be solved a number of ways but...

[tt]
Dim P As Picture

Set P = LoadPicture("Path To Graphic")

MsgBox "Width = " & P.Width & " Height = " & P.Height
[/tt]

Good Luck

 
Thanks for your reply
But i want to show the image in 640x480 size only not actual size


-Mal
 

Ahhhh... Ok, use an image control with the stretch property set to true, but if you are wanting to keep the aspect ratio of the image and make sure it fits into the box (if it is larger) then you could use the code above to figure out how much you will have to reduce/enlarge your picture by.

Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top