FMX drawing problem

I am having trouble drawing in FMX, with what it draws being rather different from what the programme draws when built for windows.

Background: edit boxes on FMX are almost invisible when empty. They have no borders, and are transparent. I want to make a couple of them obvious, by putting them on a coloured background with the area for the edit box whited out, with a black border around the box.

The programme demonstrating the problem is http://c443799.r99.cf2.rackcdn.com/ImageLines.zip

It works beautifully on windows, and nothing like what it is supposed to do no FMX.

Anyone else had similar problems? Or is there some FMX difference I have failed to grasp?

The problem occurs on a samsung s22, a huawei P20 pro, and a couple of tablets (s2 and s8).

This seems like a styling issue. Have you considered using styles ? If you are going to, you’ll need one style for each target OS.

Agreed, although https://www.embarcadero.com/free-tools/firemonkey-stencils claims to enable “platform agnostic” theming

No, I am not after styles. I just need to know if there is an FMX drawing bug (in which case I would like a fix), or something I don’t understand about FMX/Windows differences (in which case a new brain might help!).
It just seems that the FMX routines do not do what they are supposed to and where they put things is not where they put them with the same values in Windows! Run the programme in windows, then in android, and tell me what you think.

Just checking - you are asking about fmx on android vs fmx on windows ?

I did not know there was FMX on windows. All I know is that if I set the target to windows 32 it works fine. If I set the target to an android device it screws up the drawing something horrid!

1 Like

Paul, did you have any suggestions? I really, really want to find out how to get the drawing stuff working under FMX on studio 11.1. It worked on previous versions, and screws up something horrid on 11.1, as per the demo programme. I don’t want theming: I want the most basic stuff to work, and it doesn’t!

In FMX, pretty much any control can contain any other control, would having the edits being contained in another control give you a usable result? Would avoid any drawing…

Interesting thought - thanks. However, I still want to be able to draw on a canvas, and all I am getting is very strange results. Is nobody else having these problems?

Your example zip gives security warnings trying to download it. Can you post a minimal source example here that demonstrates the problem?

Elvind, FireFox gives a security warning on the cloud file server, but Chrome and Edge have no problem with it. (I told FireFox to go ahead and download it, and it did, and the files are ok).

Hi Chester
If you are trying to draw on a raw FMX canvas My Library on git

May give you some help

Code basically plots Long Lat points on an image and adds scale bars. But has lots of examples of putting a line or ellipse on the image.

From memory I had trouble with canvas scaling on some phones especially on a raw canvas so I opted to use an image canvas.