微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

delphi – 使用TScaledLayout和自定义样式绘制问题

我在组合TScaledLayout和从fmx中的位图样式设计器创建的自定义样式时遇到绘画问题.

为了演示,我加载了通过选择“VCL / FMX的新样式”创建的自定义样式 – >位图样式设计器中的“另存为.style”.我在一些彩色矩形上放了几个标准控件:红色& TScaledLayout上的绿色,直接在表单上的蓝色.当我拉伸表格时,ScaledLayout上的控件上会出现彩色线条;背景部分可见:

如果我将表单的大小设置为与设计时尺寸完全匹配,则线条会消失.这似乎是一个非常重要的问题,我当然不能像这样一起使用这两个.有没有人对可能的修复或解决方法有所了解?

解决方法

看起来这是缩放和位图的已知问题.请参阅此处的Google讨论 – https://plus.google.com/+PaulThornton/posts/ACAHkJD3a84.我将引用marco Cantu的想法:

I’ve found an internally reported issue of a similar case,but haven’t
found one that matches this scenario. Certainly worth adding to quality
portal. Having said this,I fear that bitmap-based operations and
scaling don’t really fit together very well,and it might be difficult
to have an all encompassing solution.

Let me explain with an example. Take a button. This is painted by FMX
with 9 sections (borders,corners,central part) so that regardless of
the size the bitmap elements are stretched in one direction at most,
often just draw. Stretching a single bitmap for the button to the
target size would break anti-aliasing and create a blurred image when
using colors.

This is example what happens with a ScaledLayout,given it takes the
complete final image and transforms it. ScaledLayout was originally
introduced with vector styles,and worked very well in that scenario.
With todays’s bitmap styles things get a bit more complex.

Regardless of this explanation of there the issue lies,I’d recommend reporting it on QC,and I’ll make sure it doesn’t get closed as design (it Could naturally happen,this is how the system works) but that we do some investigation to address the issue — turning this into a feature request.

原文地址:https://www.jb51.cc/delphi/101779.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐