Hello all

Hello all,
I want to open TImage to full screen like photo gallery and i don't know hot it can possible?

Comments

  1. A form without border, its state set to "wsMaximised" and a TImage with align "alClient". That's a good beginning, you should find more details with google ;)

    ReplyDelete
  2. Sébastien Paradis
    Yes you are right but i mean somthing sample like click on image and its open in full screen

    P.S. i mean its in IOS.

    ReplyDelete
  3. This should do the trick:
    uses
      ...
      Macapi.ObjectiveC,
      Macapi.CocoaTypes,
      Macapi.Foundation,
      Macapi.AppKit,
      FMX.Platform.Mac;

    ...
    {$IF NOT DECLARED(NSWindowCollectionBehaviorFullScreenPrimary)}
    const
      NSWindowCollectionBehaviorFullScreenPrimary = 128;
    {$IFEND}

    type
      TOCLocalAccess = class(TOCLocal);

    function NSWindowOfForm(Form: TCommonCustomForm): NSWindow;
    var
      Obj: TOCLocal;
    begin
      Obj := (FmxHandleToObjC(Form.Handle) as TOCLocal);
      Result := NSWindow(TOCLocalAccess(Obj).Super);
    end;
    ...
    procedure TMainForm.FormCreate(Sender: TObject);
    var
      ScreenSvc: IFMXScreenService;
      SSize: TPointF;
    begin
      NSWindowOfForm(Self).setCollectionBehavior
        (NSWindowCollectionBehaviorFullScreenPrimary);
        if TPlatformServices.Current.SupportsPlatformService(IFMXScreenService, IInterface(ScreenSvc)) then
        begin
          SSize := ScreenSvc.GetScreenSize;
          Self.SetBounds(0, 0, Round(SSize.X), Round(SSize.Y));
        end;
    ...
    end;

    ReplyDelete

Post a Comment