|
|
@@ -394,15 +394,17 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
|
|
|
return bmap;
|
|
|
}
|
|
|
|
|
|
- public Bitmap ScaleImageProportional(Image sourceImage, int newWidth, int newHeight)
|
|
|
+ public Bitmap ScaleImageProportional(Image _Image, double ratio)
|
|
|
{
|
|
|
+ var newWidth = (int)(_Image.Width * ratio);
|
|
|
+ var newHeight = (int)(_Image.Height * ratio);
|
|
|
Bitmap result = new Bitmap(newWidth, newHeight);
|
|
|
using (Graphics g = Graphics.FromImage(result))
|
|
|
{
|
|
|
g.CompositingQuality = CompositingQuality.HighQuality;
|
|
|
g.SmoothingMode = SmoothingMode.HighQuality;
|
|
|
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
|
|
- g.DrawImage(sourceImage, 0, 0, newWidth, newHeight);
|
|
|
+ g.DrawImage(_Image, 0, 0, newWidth, newHeight);
|
|
|
}
|
|
|
return result;
|
|
|
}
|