jptechon
(jptechon)
February 3, 2021, 8:16am
1
delphi 10.3.3
Hydra: 6.2.101.1237.
RO/DA:10.0.0.1463
host: vcl
plugin:fmx
I created a fmx VisualPlugin and vcl host use “ShowParented” to a TPanel. In normal scaling it can show correctly.
if the windows set to scaling to 150%, it only show top part of it (in fmx plugin all control align already set to scale).
How to let plugin show correctly at a scaling bigger than 100%.
joe
EvgenyK
(Evgeny Karpov)
February 3, 2021, 10:06am
2
Hi,
Looks like, I can’t reproduce any issues with the CrossPlatform
sample at 150% dpi:
Can you attach a simple testcase that reproduces your issue, pls?
you can drop email to support@ for keeping privacy
jptechon
(jptechon)
February 3, 2021, 11:57am
3
I already sent the support please check email.
my windows : Windows 10
The edit box and Button in the recetangle is the fmx component.
Below one is correct on 100%
This one is 150%
EvgenyK
(Evgeny Karpov)
February 3, 2021, 1:10pm
4
Hi,
you need to recalculate Width/Height in OnResize event:
I’ve added two events:
var
a,b: Double;
procedure TFmxVPForm_Login.HYFMXVisualPluginCreate(Sender: TObject);
begin
a := Rectangle1.Position.X;
b := Rectangle1.Position.Y;
end;
procedure TFmxVPForm_Login.HYFMXVisualPluginResize(Sender: TObject);
begin
Rectangle1.Position.X := a /Self.Handle.Scale;
Rectangle1.Position.Y := b /Self.Handle.Scale;
Rectangle1.Width := (Width - 2*a)/Self.Handle.Scale;
Rectangle1.Height := (Height - 2*b)/Self.Handle.Scale;
end;
because you have a control located not at (0,0).