you can use the Canvas' method DrawLine() to draw a line with 1 pixel width. Anyway, trying to compose a complete image by using Canvas and setting pixels one by one will be very inefficient. The Embedded Wizard Graphics Engine pipeline is not optimized to access the pixel individually. This is even not possible on particular target systems like the OpenGL ES. Generally, there are following application cases:
1. You compose the GUI application from views and other GUI components. Embedded Wizatrd optimizes the composition trying to elliminate unnecessary operations.
2. You use the Canvas object and fill it with rectangles, images, text, etc. You benefit from the optimized routines to draw the affected shapes. If your target supports hardware acceleration, it is used here. In fact, the here used functionality is the basement for the view composition mentioned in the item 1 above.
3. You want to create a pixel image. In this case create and fill an Extern Bitmap. With Extern Bitmap you can access and modify the pixel memory of the bitmap directly in the native code (ANSI C). In other words you can calculate and set pixel individually. See also: Displaying dynamically loaded images and Extern Bitmap interface.
thank you I'm fine. I hope you are doing well these days too.
Concerning your question, well, you can draw pixel by using FillRectangle or DrawLine. In fact, you draw 1-pixel large line or rectangle. However, I expect in this case very bad performance. The drawing functions have an overhead resulting from the necessary preparation of the drawing instructions, time needed to trigger the HW (e.g. PXP) and synchronize with the following drawing operations. This approach is thus useful only if you have few pixel to draw.
If you have an application case where you need to compose an image programmatically and none of the Embedded Wizard drawing functions works for you, the recommended approach would be to prepare the image within an Extern Bitmap as explained in my first answer of this thread. With this approach you can directly address the bitmap memory and flexibly set the pixel.
I hope, it helps you further.
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!