Search code examples
screenshotfiremonkeydelphi-10.2-tokyo

Create a screenshot from the View in Delphi 10?


I want to create a screenshot from the View function in Delphi 10 instead of having to compile the app to the target device and then screenshot the app there. This would let me create mock-ups for approval without having to compile to every device for every sample screen. All help appreciated.


Solution

  • This will allow you to run mobile style on Windows.

    1. Save your current mobile style in file (*.style)
    2. Open this text file in Notepad and find PlatformTarget For example PlatformTarget = '[ANDROID][DARKSTYLE][DEFINEFONTSTYLES]'
    3. Replace it with PlatformTarget = '[MSWINDOWS][DARKSTYLE][DEFINEFONTSTYLES]' Save it.
    4. Load this style as Windows style in StyleBook. Now you will see mobile style on windows.

    If firemonkey scales form and make it large because of large system dpi - paste this line in dpr file (Project > View source).

    GlobalUseGPUCanvas := true; Application.Initialize;

    This will disable scaling.

    Another way - you can use NOX emulator on Windows, and takes screenshots from here.

    P.s. - Do not use Delphi Tokyo to develop Android apps - it makes apps slow, unstable and buggy (or wait for Tokyo update). Use prev Delphi version - Berlin update 2.