8

I'm experiencing painting issues when combining TScaledLayout and custom styles created from the bitmap style designer in fmx.

To demonstrate, I loaded the default custom style created by chosing "New style for VCL / FMX" -> "save as .style" in the bitmap style designer. I dropped several standard controls on some colored rectangles: The red & green ones on a TScaledLayout, the blue one directly on the form. As I stretch the form, colored lines appear on the controls on the ScaledLayout; the background is partially visible:

paint issue with stretched controls

If I size the form to exactly match the design-time dimensions, the lines disappear. That seems like a pretty significant issue, I certainly can't use those two together like that. Does anybody have an idea for a possible fix or workaround?

DNR
  • 1,619
  • 2
  • 14
  • 22

1 Answers1

0

Looks like this is a known issue with scaling and bitmaps. See the Google+ discussion here - https://plus.google.com/+PaulThornton/posts/ACAHkJD3a84. I'll quote Marco Cantu's thoughts:

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.

norgepaul
  • 6,013
  • 4
  • 43
  • 76
  • I have found that this seems to be an issue with D2D, if I force using GDI+ (FMX.Types.GlobalUseDirect2D := false) it works fine. That's obviously not a very good solution though, since it sacrifices all the advantages of D2D. How does that align with Marco's explanation? – DNR Nov 05 '15 at 14:02