Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How do I work around these FMX Canvas visual glitches?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Feb 12, 2018 4:07 AM Last Post By: Inmatrix CEO
Inmatrix CEO

Posts: 5
Registered: 6/19/03
How do I work around these FMX Canvas visual glitches?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 6, 2018 3:13 AM
I am trying to develop a multi-platform color picker dialog comprised of a TCalloutRectangle as the background, TColorPanel, 3xTBWTrackBar (to control specific R/G/B values) and a few TLabels to display the actual values.

I am manually resizing each control based on a percentage of the screen's resolution. In the sample images below I only resized one TBWTrackbar and one TLabel as a test, the others are just floating in their original size.

However, depending on the FMX canvas used, I get different visual glitches (this is under Windows 7 64bit, latest drivers).

With the default canvas, I get weird lines near the resized controls:
http://zoomplayer.com/t/canvas_glitches1.png

If I set "FMX.Types.GlobalUseGPUCanvas" to true, the resized TLabel are not rendered correctly, it looks as if they are rendered at their original resolution and then scaled after the render instead of being rendered in the correct resolution.
http://zoomplayer.com/t/canvas_glitches2.png

This is the code I used to set the label/font size:
    ccHeight                            := Trunc(ColorPanelPopout.Height-ColorPanelPopout.CalloutLength);
    LabelCCRed.Height                   := Trunc(ccHeight*0.02);
    LabelCCRed.TextSettings.Font.Size   := LabelCCRed.Height;
Startek Startek

Posts: 16
Registered: 2/4/17
Re: How do I work around these FMX Canvas visual glitches?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 6, 2018 8:37 PM   in response to: Inmatrix CEO in response to: Inmatrix CEO
Yeah, ugly bugs.

Have you tried doing a full Invalidate or Repaint after the resize?

Reiner

On 6/02/2018 10:13 PM, Inmatrix CEO wrote:

I am trying to develop a multi-platform color picker dialog comprised of a TCalloutRectangle as the background, TColorPanel, 3xTBWTrackBar (to control specific R/G/B values) and a few TLabels to display the actual values.

I am manually resizing each control based on a percentage of the screen's resolution. In the sample images below I only resized one TBWTrackbar and one TLabel as a test, the others are just floating in their original size.

However, depending on the FMX canvas used, I get different visual glitches (this is under Windows 7 64bit, latest drivers).

With the default canvas, I get weird lines near the resized controls:
http://zoomplayer.com/t/canvas_glitches1.png

If I set "FMX.Types.GlobalUseGPUCanvas" to true, the resized TLabel are not rendered correctly, it looks as if they are rendered at their original resolution and then scaled after the render instead of being rendered in the correct resolution.
http://zoomplayer.com/t/canvas_glitches2.png

This is the code I used to set the label/font size:
     ccHeight                            := Trunc(ColorPanelPopout.Height-ColorPanelPopout.CalloutLength);
     LabelCCRed.Height                   := Trunc(ccHeight*0.02);
     LabelCCRed.TextSettings.Font.Size   := LabelCCRed.Height;

Eli M

Posts: 1,346
Registered: 11/9/13
Re: How do I work around these FMX Canvas visual glitches?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 7, 2018 6:25 AM   in response to: Inmatrix CEO in response to: Inmatrix CEO
Inmatrix CEO

Posts: 5
Registered: 6/19/03
Re: How do I work around these FMX Canvas visual glitches?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 12, 2018 4:07 AM   in response to: Inmatrix CEO in response to: Inmatrix CEO
I am replying to my own post with a bit more information/work-around.

At least some of these glitches seem to be related to the controls size/position not being a round value.
I was setting the control's size based on a percentage of the form's size and was passing fractional values.

It seems that the GPU renderer really doesn't perform well with fractional values as it applies really low quality interpolation on the controls which makes them very blurry.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02