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

前端之家收集整理的这篇文章主要介绍了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.

猜你在找的Delphi相关文章