read the bitmap drawing resolution

I am trying to read the drawing resolution in a script. I would need to know what the pixel density is set to and the width/height