in Getting started by


I have just tried to scale up the "HelloWorld" example for RasPi-3B as my setup works with a 1200x1080 resolution touch screen.

I had no problems scaling the frame (Bounds prop) and the image with the rest of the text. But I can't figure out how to scale up the Touch Handler.

 At the moment the touch is working on the whole screen but it is only being applied to the original resolution (800x480). e.g: When the lower-right corner is touched the red icon moves to de "center" (lower-right corner of 800x480 screen) of the screen and when the top-left corner is touched it actually moves to the desired position.  So the touch screen works but the program is scaling down its output.

 The behavior is that everything is scaled up except the `SimpleTouchHandler.CurrentPos` method.

Profile.ScreenSize is set up correctly as well as framebuffer and the points of the TouchHandler object are also correctly configured.

Initialize Display...                        [OK]
Initialize Touch Driver...                   [OK]
Initialize Memory Manager...                 [OK]
Initialize Graphics Engine...                [OK]
Create Embedded Wizard Root Object...        [OK]
Create Embedded Wizard Viewport...           [OK]
Starting Embedded Wizard main loop - press <p> to shutdown application...
Target system                                RaspPi-3B (OpenGL ES 2.0/EGL/fbdev)
Color format                                 RGBA8888
MemoryPool address                           0x0007320C
MemoryPool size                              8388608 bytes
Framebuffer size                             1920 x 1080
EwScreenSize                                 1920 x 1080
Graphics accelerator                         OpenGL ES 2.0
Vector graphics support                      enabled
Warp function support                        enabled
Index8 bitmap resource format                enabled
RGB565 bitmap resource format                enabled
Bidirectional text support                   enabled
Operating system                             Embedded Linux
Toolchain                                    GCC
C-Compiler version                           8.3.0
Build date and time                          Feb 16 2021, 23:26:31
Runtime Environment (RTE) version            10.00
Graphics Engine (GFX) version                10.00
Max surface cache size                       8388608 bytes
Glyph cache size                             256 x 256
Max issue tasks                              256
Surface rotation                             0

Any hint is welcomed.


2 Answers

0 votes
Best answer

currently, the Build Environments for Raspberry Pi (3B and 4B) are prepared to work with the official Raspberry Pi 7" touch display with a screen resolution of 800x480 pixel.

Of course, you can adapt your own display (as you already have done) and your own touch device. If you want to adapt the touch coordinates, please have a look into the file ew_bsp_touch.c: There you will find the function EwBspTouchGetEvents() which is called from the main loop - there you can implement the mapping from touch coordinates to GUI coordinates.

The touch coordinates have to match always the GUI coordinates - there is no adaptation required within the Touch Handlers.

Does this help?

Best regards,

0 votes

Thank you @Manfred Schweyer for pointing me in the right direction.

The solution was to change the (ewconfig.h) framebuffer to 1020 x 600 and that fixed the issue.

It looks like the touchscreen has a much smaller resolution than the screen... I don't fully understand the issue but that solved it!


#define FRAME_BUFFER_WIDTH              1020
#define FRAME_BUFFER_HEIGHT             600


Embedded Wizard Website | Privacy Policy | Imprint