画像貼り付け時の比率が元画像から大きく変化する。

お世話になっております。
PictureクラスのAddPictureメソッドで画像を貼り付けましたが、縦横の比率が崩れます。
貼り付け後に各プロパティで調整してもExcelで開くと想定している比率になりません。
対応方法はありますでしょうか。
添付の画像はスケール100%でQRコードを貼り付けたものになりますが高さが103%となってしまいます。
よろしくお願いします。

SS.PNG (34.3 KB)

@TakaIkeda,

スクリーンショットをありがとう。

ニーズに合っている場合は、次のサンプルコードを試してください。
例えば

            var _wb = new Workbook("e:\\test2\\Book1.xlsx");

            var _ws = _wb.Worksheets[0];
            var _img = Image.FromFile("e:\\test\\image.jpg");
           
            using (var _ms = new MemoryStream(ImageToByteArray(_img)))
            {
                var _pic = _ws.Pictures[_ws.Pictures.Add(0, 0, _ms)];
                _pic.RelativeToOriginalPictureSize = true;
                _pic.WidthScale = 100;
                _pic.HeightScale = 100;
            }

            _wb.Save("e:\\test2\\out1.xlsx"); 

それでも問題が解決しない場合は、画像ファイルを共有してサンプルコード(実行可能)を貼り付けてください。すぐに確認します。

返答ありがとうございます。
さらに状況を確認したところAsposeの問題ではなく、恐らくExcelのバージョンによるものでした。
対象のバージョン:2204(15128.20280)
これはテストを実施していた人のPCにのみに発生し、他のPCでは同じファイルを開いても画像が歪むことはありませんでした。
これはAsposeの問題では無いので別途調査します。

Thank you for your reply.
When I checked the situation further, it was not an Aspose problem, but probably due to the version of Excel.
Target version: 2204 (15128.20280)
This only happened on the PC of the person doing the test, and on other PCs opening the same file did not distort the image.
This is not an Aspose issue and will be investigated separately.

@TakaIkeda,

問題を整理したことを知っておくとよいでしょう。 ご不明な点や問題がございましたら、お気軽にご返信ください。 すぐにお手伝いさせていただきます。