Keep aspect ratio using watermark image instead of canvas

This commit is contained in:
Jaex 2020-07-05 11:05:43 +03:00
parent 4a444ca164
commit 7577bdd0a4
3 changed files with 3 additions and 3 deletions

View file

@ -772,7 +772,7 @@ internal static string DrawImageSizeMode_PercentageOfCanvas {
}
/// <summary>
/// Looks up a localized string similar to Percentage of watermark.
/// Looks up a localized string similar to Percentage of image.
/// </summary>
internal static string DrawImageSizeMode_PercentageOfWatermark {
get {

View file

@ -1248,6 +1248,6 @@ Would you like to download and install it?</value>
<value>Percentage of canvas</value>
</data>
<data name="DrawImageSizeMode_PercentageOfWatermark" xml:space="preserve">
<value>Percentage of watermark</value>
<value>Percentage of image</value>
</data>
</root>

View file

@ -96,7 +96,7 @@ public override Bitmap Apply(Bitmap bmp)
{
int width = (int)Math.Round(Size.Width / 100f * bmp.Width);
int height = (int)Math.Round(Size.Height / 100f * bmp.Height);
imageSize = ImageHelpers.ApplyAspectRatio(width, height, bmp);
imageSize = ImageHelpers.ApplyAspectRatio(width, height, bmpWatermark);
}
else
{