I think may be you may set the width and height of the image view to match parent then you may add margins (left,right,top and bottom) according to d1,d2,d3 and d4
then set the scale type of the image view to fit xy.....I am not so sure of the last step but I think I will work