public interface ScalableSurface
NativeSurface implementation,
see setSurfaceScale(int[]).| Modifier and Type | Field and Description |
|---|---|
static int |
AUTOMAX_PIXELSCALE
Setting surface-pixel-scale of 0, results in maximum platform dependent pixel-scale, i.e.
|
static int |
IDENTITY_PIXELSCALE
Setting surface-pixel-scale of 1, results in same pixel- and window-units.
|
| Modifier and Type | Method and Description |
|---|---|
int[] |
getCurrentSurfaceScale(int[] result)
Returns the current pixel scale of the associated
NativeSurface. |
int[] |
getNativeSurfaceScale(int[] result)
Returns the native pixel scale of the associated
NativeSurface
reflecting it's currently bound monitor surface resolution in pixels. |
int[] |
getRequestedSurfaceScale(int[] result)
Returns the requested pixel scale of the associated
NativeSurface. |
void |
setSurfaceScale(int[] pixelScale)
Request a pixel scale in x- and y-direction for the associated
NativeSurface. |
static final int IDENTITY_PIXELSCALE
static final int AUTOMAX_PIXELSCALE
void setSurfaceScale(int[] pixelScale)
NativeSurface.
Default pixel scale request for both directions is AUTOMAX_PIXELSCALE.
In case platform only supports uniform pixel scale, i.e. one scale for both directions,
either AUTOMAX_PIXELSCALE or the maximum requested pixel scale component is used.
The requested pixel scale will be validated against platform limits before native scale-setup,
i.e. clipped to IDENTITY_PIXELSCALE if not supported or clipped to the platform maximum.
It can be queried via getRequestedSurfaceScale(int[]).
The actual realized pixel scale values of the NativeSurface
can be queried via getCurrentSurfaceScale(int[]) or
computed via surface.
convertToPixelUnits(new int[] { 1, 1 })
pixelScale - requested surface pixel scale int[2] values for x- and y-direction.int[] getRequestedSurfaceScale(int[] result)
NativeSurface.result - int[2] storage for the resultint[] getCurrentSurfaceScale(int[] result)
NativeSurface.result - int[2] storage for the resultint[] getNativeSurfaceScale(int[] result)
NativeSurface
reflecting it's currently bound monitor surface resolution in pixels.
The native pixel scale maybe used to determine the proper dpi
value of this NativeSurface:
surfacePpMM = monitorPpMM * currentSurfaceScale / nativeSurfaceScale,
with PpMM == pixel per millimeter
result - int[2] storage for the resultCopyright 2010 JogAmp Community.