Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
こんにちは、Platform SDK (Windows SDK) サポートチームです。
今回は、Win32 API である LoadImage 関数の不具合についてご案内します。
現象
Windows 10 において、アプリケーションから負の高さをもつビットマップ ファイルを指定して LoadImage 関数を実行すると、ビットマップがロードできずに失敗し、NULL が返ります。Windows 7 では成功し、ビットマップがロードできていました。
原因
この現象は、LoadImage 関数の不具合によって発生します。関数内において、ビットマップの高さとして負数があり得ることを考慮していないことが原因です。
回避策
現在、この問題を修正する予定がありません。
GDI+ など、ほかの API を利用することを検討してください。
参考情報
LoadImageW function
https://docs.microsoft.com/ja-jp/windows/desktop/api/winuser/nf-winuser-loadimagew
Using Images, Bitmaps, and Metafiles
https://msdn.microsoft.com/ja-jp/library/windows/desktop/ms533815.aspx
Bitmap class
https://msdn.microsoft.com/ja-jp/library/windows/desktop/ms534420.aspx,