0

I was trying to reproduce a small example (same problem with Delphi 10.3 and 10.4). My question: how to fix these "strange" extra lines? Is there a better resolution to fix the ImageList? (I put bigger images but looks like imagelist issue)

Original Size:

enter image description here

Full Screen:

enter image description here

Some extra lines are happening. I create de objects first and after I included ScaledLayout.

Code:

unit Unit1;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
  System.ImageList, FMX.ImgList, FMX.Menus, FMX.Objects, FMX.Layouts;

type
  TForm1 = class(TForm)
    Image1: TImage;
    PopupMenu1: TPopupMenu;
    MenuItem1: TMenuItem;
    ImageList1: TImageList;
    MenuItem2: TMenuItem;
    MenuItem3: TMenuItem;
    MenuItem4: TMenuItem;
    ScaledLayout1: TScaledLayout;
    procedure Image1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.fmx}

procedure TForm1.Image1Click(Sender: TObject);
begin
  PopupMenu1.Popup(Image1.Position.X,Image1.Position.Y);
end;

end.
  • Thank you for the example project that clearly shows the issue with a `TPopupMenu`. I could however not reproduce the problem with other controls, but I did not try all of them. I also tried adding a style ("Air.Style") and it removed the lines. Then again with another style ("Transparent.Style") the lines appear when mouse moves over popup menu items. There is another [old post](https://stackoverflow.com/q/33529842/2292722) that mentions the same problem with other controls. The problem has been reported to Embarcadero, but obviously not solved yet. – Tom Brunberg Oct 20 '21 at 17:36
  • To PopupMenu open over image: procedure TForm1.Image1Click(Sender: TObject); var P : TPointF; begin P.X := 0; P.Y := 50; P := Image1.LocalToAbsolute(P); P := ClientToScreen(P); PopupMenu1.Popup(P.X,P.Y); end; – Wellington Telles Cunha Oct 20 '21 at 18:31
  • 1
    I don't understand your previous comment. The lines are visible in the popup menu irrespective of images in the menu items, or if there are images behind the popup menu. I do not know how to prevent the lines, except using "Air.Style". – Tom Brunberg Oct 21 '21 at 06:24
  • Thank you. I never used Styles, but with Air Style, the problem does not happen. I was wondering about glyph (when I need to use different resolutions) inside the button and popup menu resolution too, I believe that I will need to use an image instead of a button to get the best results. – Wellington Telles Cunha Oct 22 '21 at 17:01

0 Answers0