BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TCanvas

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Chri
Guest





PostPosted: Fri Nov 21, 2003 3:40 pm    Post subject: TCanvas Reply with 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.



Back to top
Dennis Jones
Guest





PostPosted: Fri Nov 21, 2003 5:01 pm    Post subject: Re: TCanvas Reply with quote




"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





PostPosted: Fri Nov 21, 2003 5:15 pm    Post subject: Re: TCanvas Reply with quote



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





PostPosted: Fri Nov 21, 2003 5:48 pm    Post subject: Re: TCanvas Reply with quote

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





PostPosted: Fri Nov 21, 2003 8:21 pm    Post subject: Re: TCanvas Reply with quote


"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.