Programming-Project
Ultibo / Lazarus / Free Pascal
of Ronald Daleske

Example 02 - screeenshot and graphical programming with ultibo core - using bitmaps


Atention: This Example run only with Core Ultibo core 1.2.073 (from 12.07.2016).

ScreenShot


This is just a small example to show how you can make a ScreenShot.

Atention: The size of the bitmap is very large. The saving of the file takes over 15 seconds. Removing the SD-Card not, before the saving is completed.

Atention: The ScreenShot use a size of 1280x1024. If you use an other monitor size, please change the const in the source code (auto size is to do).

Atention: The unit "RUtil.pas" needed the following units "console.pas" and "rgraphics.pas".

screeenshot and graphical programming for RPI: 10_gp_02.zip

boot with test-files for RPI: 05_boot.zip

Atention: Do'nt forget to copy the bitmaps to the sd-card.



New unit "rgraphics.pas" for the ultibo core

The unit "rgraphics.pas" includes all important functions around the TBitmap. The function "LoadFromFile" reads a bitmap from the SD-Card and and stores the result in a MemoryStream. This MemoryStream can be copied to the framebuffer with the function "FramebufferConsoleDrawStream" or "FramebufferConsoleDrawTransStream".

With the function "SaveToFile" can a MemoryStream stored to a bitmap-file on the SD-Card.

In this version of the unit "rgraphics.pas" can only read and write bitmaps with 24-bit color depth.

The MemoryStream is ever in the same format as the content of the framebuffer (32-bit AGBR).



Test-Project under X86/Win32 Lazarus for the unit "rgraphics.pas"

For the development of these new unit is a lazarus project on windows with debugger very helpful. It shows loging information and the imported bitmap.


Atention: This project run under Lazarus for Windows (X86/Win32) and not under ultibo arm. The unit "rgraphics.pas" run under both platforms.

Test-Project Lazarus for Windows for unit "rgraphics.pas": 50_Lazarus_Win32_RGraphics.zip