Skip to content

Pad the image to make sure if fits the surface area of the viewport and make sure the image scales w.r.t DPI

Notifications You must be signed in to change notification settings

BrowserStackCE/image-padding-scale-dpi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pad images for image injection feature

Setup

  • Clone the repo
  • Install dependencies
  • Update the input and output directories
  • Run the code to generate the padded images.

Custom Configurations

  • Based on the device set the DPI. Update the mmPixels variable. 522 is the DPI value for Samsung Galaxy S24 Ultra
  double mmToPixels = 522.0 / 25.4;
  • Adjust the coordinates based on the needs
            int backgroundWidthMM = 105;
            int backgroundHeightMM = 148;
            int imageWidthMM = 115;
            int imageHeightMM = 66;
            int xCoordinateMM = -12;
            int yCoordinateMM = 40;

About

Pad the image to make sure if fits the surface area of the viewport and make sure the image scales w.r.t DPI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •