 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Thaddeus L. Olczyk Guest
|
Posted: Thu Oct 14, 2004 4:29 am Post subject: How to draw on a form. |
|
|
There are times when I need to be able to make simple drawings on a
form. I used to do this a lot but can't remember how.
IIRC the basic idea was to put a TPanel on the Form
then put two images. One I display, the other I get
yhe canvas of then draw to. Then I toggle the visible and the drawn,
to give me flickier free drawing. The problem is that this is real
slow. Suggestions?
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Thu Oct 14, 2004 7:41 am Post subject: Re: How to draw on a form. |
|
|
Thaddeus L. Olczyk wrote:
| Quote: | There are times when I need to be able to make simple drawings on a
form. I used to do this a lot but can't remember how.
|
You can draw on a TForm::Canvas directly with TextOut(), LineTo()
and so on.
You can put a TPaintBox on a TForm. Now you can draw in
an area of the TForm.
| Quote: | IIRC the basic idea was to put a TPanel on the Form
then put two images.
|
Technically you do not need a TPanel.
| Quote: | One I display, the other I get
yhe canvas of then draw to. Then I toggle the visible and the drawn,
to give me flickier free drawing. The problem is that this is real
slow. Sugg
|
One TImage will do. Take a Graphics::TBitMap::Canvas to draw on
and copy the result to the TImage.
You said "simple drawings", well than a TPaintBox would do always.
Just put your code in TPaintBox::OnPaint.
Hans.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|