I want to get native app width and height of screenshot?


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:


…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();

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 :slight_smile:

Ok. Thank you. I will looking in to it.

is there any way to convert points value to pixels?