Well this is quite simple really.
First turn the health value into a percentage of the total.
Code:
float fHealthCoef=(float)CurrentHealth/(float)TotalHealth;
Now take this value and multiply it by the vertical height or horizontal width of your health meter.
Code:
float fHealthBarSize=fHealthBarGaugeSize*fHealthCoef;
Now find the starting x,y and add fBarSize to the correct component.
This would be for a horizontal gauge
Code:
float fHealthBarRight=(float)HealthBarGaugeLeft+fHealthBarSize;
..convert to integer and draw bar here
This is akin to a progress bar control in win32 programming. That stupid bar that comes up when you are installing programs that tells you how much is left to install(if you are pessimistic) or how much has been installed (if you are optimistic).