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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image dimensions for a form background

Status
Not open for further replies.

dstrange

Programmer
Nov 15, 2006
87
CA
Hi, maybe I'm missing something but what measurement are a form's width and height in. It's not pixels. I was trying to make an image background for my form using the height and width of the form for the height and width of the image. I thought it was in pixels but it is not. Anyone know what VB dimensions are in? Better yet does anyone know an easy way to calculate an image size for a form?

Thanks in advance.
 
A Form's Width and Height Properties are measured in Twips; however that is the outer measurement of the Form. The area you want to fill with your image (the inner one) is Form.ScaleHeight by Form.ScaleWidth; that is measured in Twips by default but can be controlled by use of the Forms ScaleMode Property or Scale Method.
Twips can be converted to Pixels with;
Pixels = Twips/Screen.TwipsPerPixelX 'horizontal
Pixels = Twips/Screen.TwipsPerPixelY 'vertical
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top