 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Chri Guest
|
Posted: Fri Nov 21, 2003 3:40 pm Post subject: TCanvas |
|
|
Hi, can anyone tell me how can I get the Canvas of a TPanel control? This
because I have to draw on a panel and I need the TCanvas class because it
provide a lot of nice function member: CopyRect is very usefull and I use it
a lot!!! Thanks, Chri.
|
|
| Back to top |
|
 |
Dennis Jones Guest
|
Posted: Fri Nov 21, 2003 5:01 pm Post subject: Re: TCanvas |
|
|
"Chri" <chrip (AT) libero (DOT) it> wrote
| Quote: | Hi, can anyone tell me how can I get the Canvas of a TPanel control? This
because I have to draw on a panel and I need the TCanvas class because it
provide a lot of nice function member: CopyRect is very usefull and I use
it
a lot!!! Thanks, Chri.
|
Canvas is not an exposed property of TPanel. You could, however, place a
TImage on the panel, and use its Canvas instead.
- Dennis
|
|
| Back to top |
|
 |
Chri Guest
|
Posted: Fri Nov 21, 2003 5:15 pm Post subject: Re: TCanvas |
|
|
No I prefer to use TPanel because TImage has a bad refresh (fliker
noise!!!).
"Dennis Jones" <djones (AT) nospam (DOT) com> ha scritto nel messaggio
news:3fbe44f2$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
"Chri" <chrip (AT) libero (DOT) it> wrote in message
news:3fbe31d3 (AT) newsgroups (DOT) borland.com...
Hi, can anyone tell me how can I get the Canvas of a TPanel control?
This
because I have to draw on a panel and I need the TCanvas class because
it
provide a lot of nice function member: CopyRect is very usefull and I
use
it
a lot!!! Thanks, Chri.
Canvas is not an exposed property of TPanel. You could, however, place a
TImage on the panel, and use its Canvas instead.
- Dennis
|
|
|
| Back to top |
|
 |
Giuliano Guest
|
Posted: Fri Nov 21, 2003 5:48 pm Post subject: Re: TCanvas |
|
|
On Fri, 21 Nov 2003 18:15:42 +0100, "Chri" <chrip (AT) libero (DOT) it> wrote:
| Quote: | Hi, can anyone tell me how can I get the Canvas of a TPanel control?
This
|
Hi,
try to use a TControlCanvas:
#include <memory>
using std::auto_ptr;
void __fastcall TForm1::Button1Click(TObject *Sender)
{
const auto_ptr<TControlCanvas> PanelCanvas( new TControlCanvas );
PanelCanvas->Control = Panel1;
PanelCanvas->MoveTo( 10, 10 );
PanelCanvas->LineTo( 100, 50 );
}
HTH
Giuliano
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Nov 21, 2003 8:21 pm Post subject: Re: TCanvas |
|
|
"Chri" <chrip (AT) libero (DOT) it> wrote
| Quote: | Hi, can anyone tell me how can I get the Canvas of a TPanel control?
|
Derive a new class from TPanel and promote the inherited Canvas property to
public access. Then use that class instead of the standard TPanel.
Gambit
|
|
| 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
|
|