加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

delphi – 显示JPEG,适合大于控件的图像,因此它恰好适合Timage控

发布时间:2020-12-15 09:41:44 所属栏目:大数据 来源:网络整理
导读:如果我从像 Image1.Picture.LoadFromFile(imagePath)这样的文件加载图像;并且JPEG I加载比Image1大,这是一个TImage – 如何缩放它以适应? 解决方法 将TImage控件的 Stretch 属性设置为True. Indicates whether the image should be changed so that it exac
如果我从像 Image1.Picture.LoadFromFile(imagePath)这样的文件加载图像;并且JPEG I加载比Image1大,这是一个TImage – 如何缩放它以适应?

解决方法

将TImage控件的 Stretch属性设置为True.

Indicates whether the image should be changed so that it exactly fits the bounds of the image control.

Set Stretch to true to cause the image to assume the size and shape of the image control. When the image control resizes,the image resizes also. Stretch resizes the height and width of the image independently. Thus,unlike a simple change in magnification,Stretch can distort the image if the image control is not the same shape as the image.

如本文档所示,相关替代方案是Proportional属性.

Indicates whether the image should be changed,without distortion,so
that it fits the bounds of the image control.

Set Proportional to true to ensure that the image can be fully
displayed in the image control without any distortion such as occurs
with the Stretch property. When Proportional is true,images that are
too large to fit in the image control are scaled down (while
maintaining the same aspect ratio) until they fit in the image
control. Images that are too small are displayed normally. That is,
Proportional can reduce the magnification of the image,but does not
increase it.

When the image control resizes,the image resizes also.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读