public class PixelConverter extends Object
Constructor and Description |
---|
PixelConverter(Control control)
Create a PixelConverter which will convert device-independent units to
pixels using the font of the specified control.
|
PixelConverter(Font font)
Create a PixelConverter which will convert device-independent units to
pixels using the specified font.
|
Modifier and Type | Method and Description |
---|---|
int |
convertHeightInCharsToPixels(int chars)
Returns the number of pixels corresponding to the height of the given
number of characters.
|
int |
convertHorizontalDLUsToPixels(int dlus)
Returns the number of pixels corresponding to the given number of
horizontal dialog units.
|
int |
convertVerticalDLUsToPixels(int dlus)
Returns the number of pixels corresponding to the given number of
vertical dialog units.
|
int |
convertWidthInCharsToPixels(int chars)
Returns the number of pixels corresponding to the width of the given
number of characters.
|
public PixelConverter(Control control)
control
- the control whose font should be used for pixel conversions.
Note that the font used by the control at the time this
constructor is called is the font that will be used for all
calculations. If the font of the specified control is changed
after this PixelConverter is created, then the conversions
from this instance will not produce the desired effect.public PixelConverter(Font font)
font
- the font that should be used for pixel conversions.public int convertHeightInCharsToPixels(int chars)
chars
- the number of characterspublic int convertHorizontalDLUsToPixels(int dlus)
dlus
- the number of horizontal dialog unitspublic int convertVerticalDLUsToPixels(int dlus)
dlus
- the number of vertical dialog unitspublic int convertWidthInCharsToPixels(int chars)
chars
- the number of characters
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.