Quote:
can any one tell me how to calculate image dpi by using resolution of an image?
You don't one does not imply the other.
HorizontalResolution and VerticalResolution are image size in pixels.
The DPI setting is used to reduce the size of physical printing.
printed Width = HorizontalResolution / DPI
printed Height = VerticalResolution / DPI
Understanding DPI, Resolution and Print vs. Web Images[
^]