1. Home
  2. Computing & Technology
  3. Visual Basic

VB .NET Switches to Pixel from Twip
Another Plus for VB .NET

By Dan Mabbutt, About.com

Selecting Scalemode in VB 6

Scalemode in VB 6

In VB 6 and earlier, all form measurements defaulted to a measurement called the twip. A twip twip (twentieth of a point) is really a measure more useful in traditional printing because it represents absolute distance. A twip is 1/1440th of an inch or 1/567th of a centimeter. That is, there are 1440 twips to an inch or 567 twips to a centimeter. If you're saying, "Huh?" in confusion, you're not the first. This archaic measurement has been giving VB programmers fits for years. (In fairness to Microsoft, some of their justification is that the twip is a device-independent unit of measurement and in VB 6, two properties of the Screen object, TwipsPerPixelX and TwipsPerPixelY, can be used to determine the size of the display at run time. Using these properties, it's possible to write code to make your forms more device independent.) VB .NET, however, has dropped support for the twip and the Upgrade Wizard automatically converts them into pixels using calls in the VB .NET "compatibility library". In VB .NET, they realized that a form is an object that is meant to be displayed on a computer monitor. A pixels is the unit native to that environment. A pixel (short for "picture element") is the basic unit of programmable color on a computer display or in a computer image. Think of it as a logical - rather than a physical - unit. The physical size of a pixel depends on how you've set the resolution for the display screen. Pixels per inch (ppi) is the measure of the sharpness (that is, the density of illuminated points) on a display screen. The dot pitch on a particular monitor determines the absolute limit of the possible pixels per inch. However, the displayed resolution of pixel (picture elements) that is set up for the display is usually not as fine as the dot pitch. The pixels per inch for a given picture resolution will differ based on the overall screen size since the same number of pixels are being spread out over a different space.
Explore Visual Basic
By Category
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic

©2009 About.com, a part of The New York Times Company.

All rights reserved.