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?
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.
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
Painting from scratch
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)Â
> 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)Â
Painting from scratch
A simple example is exactly what I was looking for. It's clear now, thank
you sir.
you sir.