I need to calculate the exact position of all levels, but there are some errors in the levels where there are transparent pixels.
Calculating the position in this way:
width = ref.bounds [2] - ref.bounds [0];
height = ref.bounds [3] - ref.bounds [1];
left = (ref.bounds [2] - width) / ImageWidth;
top = (ref.bounds [3] - height) / imageheight;
width = width / ImageWidth;
height = height / imageheight;
Does anyone know how to get the resolution to a level even managing the edges of transparent PNG images, perhaps without managing to calculate the bound?