Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 TPanel 中有一个带有Align := alClient、Stretch := True和的 TImage 。如何获取在图像中绘制的图片的顶部像素位置?Proportional := TrueCenter := True
Align := alClient
Stretch := True
Proportional := True
Center := True
也许描述问题的图像会有所帮助:
我看到了这个问题,但无法得到与我需要密切相关的答案。
如果图像的纵横比大于面板的纵横比,则只会在顶部和底部留下空间。假设是这种情况,所需的距离是
round(Panel.Height - (Panel.Width / Image.Picture.Width) * Image.Picture.Height) / 2);