Hi,
I want to get the width and height of the captured native screenshot ?
Hi,
I want to get the width and height of the captured native screenshot ?
With appium you can get widht and height of the screen like this:
driver.manage().window().getSize().getHeight()
driver.manage().window().getSize().getWidth()
…but if you want to know sizes of the image you can do this with Java:
try {
File f = new File(ScreenshotPath);
BufferedImage image = ImageIO.read(f);
int height = image.getHeight();
int width = image.getWidth();
}catch(…)…
Thank you @MrZigaS. Do you know how to get the scale ratio for screen shot? I have a webview with fixed width and height. I need to scale the image fit to webview size. how to do that in java ?
I suggest you make some research - the answer is out there:
Good luck
Ok. Thank you. I will looking in to it.
is there any way to convert points value to pixels?