
To follow up our current engagement with Linux development, let’s take a look on this incredible pack of sample projects available for download, to show some amazing functions that you can use on your Linux projects.
First, let’s check out how to install the pack of sample using GetIt tool on Delphi.
Open Delphi, go to menu Tools > GetIt Package Manager, type FMXLinuxSample, press Enter to search then select it and click install.
Inside the package there are several projects that you can use as example, let’s check out the “Screenshot” Example and compile it on Ubuntu.
After open the project you can see on the code the following directive on “Uses”:
1 2 3 |
{$IFDEF LINUX} uses FMX.Canvas.Linux; {$ENDIF} |
This allows your project to be used on more than one platform, and also on the event you can see:
1 2 3 4 5 6 7 8 |
{$IFDEF LINUX} B := TakeScreenshot; if B <> nil then begin ImageViewer1.Bitmap.Assign(B); B.DisposeOf; end; {$ENDIF} |
Now that we open the project let’s start the “PAServer” on our Linux, so we can deploy, check out the video below:
If you need help to set up the Linux connection on Delphi and how to run “PAServer” check out this post.
And finally let’s run the project, but before compile remember to check if the connection settings correspond to the PAServer IP, Port and password.
Adapt and increase this project as you want to make it more powerful, if you keep using directives you can run it on multiple platforms without any problem.
Head over and check out additional information about the FMXLinux Samples for Delphi over in GetIt.
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition