public class ContextBasedScaleProvider extends Object implements ScaleProvider
| Constructor and Description |
|---|
ContextBasedScaleProvider(RectangleSize topLevelContextEntireSize,
RectangleSize viewportSize,
ScaleMethod scaleMethod,
double devicePixelRatio) |
| Modifier and Type | Method and Description |
|---|---|
ScaleMethod |
getScaleMethod() |
double |
getScaleRatio() |
void |
updateScaleRatio(int imageToScaleWidth)
Set the scale ratio based on the given image.
|
public ContextBasedScaleProvider(RectangleSize topLevelContextEntireSize, RectangleSize viewportSize, ScaleMethod scaleMethod, double devicePixelRatio)
topLevelContextEntireSize - The total size of the top level
context. E.g., for selenium this
would be the document size of the top
level frame.viewportSize - The viewport size.devicePixelRatio - The device pixel ratio of the
platform on which the application is
running.public double getScaleRatio()
getScaleRatio in interface ScaleProviderpublic ScaleMethod getScaleMethod()
getScaleMethod in interface ScaleProviderpublic void updateScaleRatio(int imageToScaleWidth)
imageToScaleWidth - The width of the image to scale, used for calculating the scale ratio.Copyright © 2016. All rights reserved.