1.3k views
in GUI Development by
Hi,
just a short question about a widget to make a "paint like" application. In my GUI I should have a window and into this I want to drag the finger and draw into this some lines. Looking into elements available I don't see a specific function to do this, the only method is to draw a pixel under the finger area and have a sequence of pixel built during the movement of finger?

1 Answer

0 votes
by

Use the Canvas object to create and store such dynamic pictures. The object provides various drawing functions allowing e.g. filling areas with a color or drawing line segments, ... From technical point of view, the Canvas object can be seen like an off-screen framebuffer. All operations you perform on the screen can also be performed on an Canvas object.

The Canvas object itself is not visible. It manages the picture content only. To show the content of the Canvas object, an ordinary Image view can be used. Just assign the Canvas object to the property Bitmap of the Image view. To update the screen after the picture within an Canvas object has changed, use the method InvalidateArea().

Following example demonstrates this application. See the comments inside the project:

http://ask.embedded-wizard.de/?qa=blob&qa_blobid=18193691439290994687

For more details see interface of the Graphics::Canvas class within 'Mosaic 2.0 User Manual'.

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...