131 views
in GUI Development by

Hello Embedded Wizard Community,

I am currently working on a project that involves a grid-like template containing squares of different colors. This template is displayed on a page within my project. I would like to capture the hex color value of each square when it is touched by the user, so that the system can take appropriate actions based on the color.

My idea is to retrieve the hex color value of the pixel at the specific coordinate where the user touches the screen. Could you please guide me on how to achieve this in Embedded Wizard?

Here are some specific questions:

  1. Is there a built-in function or method in Embedded Wizard to retrieve the color of a pixel at a given coordinate?
  2. If not, what would be the best approach to implement this feature?
  3. Are there any performance considerations I should be aware of when implementing this?

Thank you in advance for your assistance. I look forward to your insights.

Best regards, 

Burak Cebesoy

2 Answers

0 votes
by
Hello burakcebesoy,

there is no common approach to read the color value at given pixel position.

Best regards

Paul Banach
by
Hello Paul Banach and Embedded Wizard Community,

Thank you for your prompt response. I understand that there is no common approach to read the color value at a given pixel position.

As a follow-up, I would like to ask if it's possible to use a "color picker" style method for touch areas instead of specific pixel positions. In other words, is there a way to detect the color in the area where the user touches the screen?

Thank you again for your assistance. I appreciate any insights you can provide.

Best regards, Burak Cebesoy
by

Hello Burak Cebesoy,

In other words, is there a way to detect the color in the area where the user touches the screen?

that is the difficulty. This application case requires the access to the frame buffer, synchronisation of pending drawing operations and eventual flushing data caches. The implementation depends therefore on the architecture of the particular target system.

Which target system are you using?

Best regards

Paul Banach

by

Hello Paul Banach and Embedded Wizard Community,

Thank you for your detailed response. I understand that the implementation depends on the architecture of the particular target system. We are using the STM32F767 series for our target system.

I have a couple of follow-up questions:

  1. I assume that I would need to access the framebuffer to retrieve the color value at a specific coordinate. Could you guide me on how to do this on the STM32F767 series?

  2. How can I ensure that the coordinate value I aim to access in the framebuffer is accurate? Is there any synchronization or calibration needed?

  3. Once I have accessed the framebuffer, how can I retrieve the color value at that specific coordinate?

Thank you again for your invaluable assistance. I look forward to your insights.

Best regards, Burak Cebesoy

0 votes
by

Hello,

in your case, you have to get access to the currently visible framebuffer and you have to read the pixel value from the location where the last touch point was detected.

Let me refer to this answer. In this discussion the question was to save the entire framebuffer content - in your case you need to save only one pixel.

Does this help?

Best regards,

Manfred.

 

by
Hello Manfred,

Thank you for your prompt and insightful response. I appreciate the reference to the discussion about saving the entire framebuffer content. In my case, as you pointed out, I only need to save the color value of a single pixel at the location where the last touch point was detected.

I will try implementing the method described in the referenced discussion and will get back to you with my findings.

Thank you again for your valuable guidance.

Best regards,
Burak Cebesoy

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...