using System.Drawing;

namespace ZionGraphics.Filtering
{
    class Resolution : IFilter
    {
        public override Bitmap Apply(Bitmap bitmap)
        {
            double proportion = (100.0 / bitmap.VerticalResolution) * Intensity;

            bitmap = new System.Drawing.Bitmap(bitmap,
                new Size(
                    (int)(bitmap.Width * (proportion / 100)),
                    (int)(bitmap.Height * (proportion / 100))
                    ));

            bitmap.SetResolution(Intensity, Intensity);

            return bitmap;
        }
    }
}
