In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Painting from scratch

Xailer English public forum
Responder
Guest

Painting from scratch

Mensaje por Guest »

Hi,
How do you paint a rectangle or other shape, from scratch, on an empty form?
The Canvas class is mentioned in the help, but there aren't any samples
that specifically illustrate creating an image or paint object from scratch.
My form is completely empty, except for a button that starts the Painting
test. I want to experiment to filling the Image with multiple colors. What
is the simplest way to do this?
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Painting from scratch

Mensaje por jfgimenez »

DGauss,
> How do you paint a rectangle or other shape, from scratch, on an empty
> form?
> The Canvas class is mentioned in the help, but there aren't any samples
> that specifically illustrate creating an image or paint object from
> scratch.
>
> My form is completely empty, except for a button that starts the Painting
> test. I want to experiment to filling the Image with multiple colors.
> What
> is the simplest way to do this?
You should do the painting in the form's OnPainted event. Attached is a
small sample.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info


Attached files Painting.zip (1.4 KB)Â
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Guest

Painting from scratch

Mensaje por Guest »

A simple example is exactly what I was looking for. It's clear now, thank
you sir.
Responder