Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 04-12-2006, 08:14 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default Canvas.

Using Canvas class of a form, how to draw something and make it stay? I can draw things but when I move another form over the form I use to draw everything is lost.

I use:

[DELPHI]self.Canvas.FillRect(SomeRect);[/DELPHI]

Regards,
Abdulaziz Jasser
Reply With Quote
  #2  
Old 04-12-2006, 08:21 AM
Chesso Chesso is offline
Senior Member
 
Join Date: May 2004
Location: Sydney, Australia
Posts: 1,199
Default RE: Canvas.

I think that you would have to re-do it handling the paint message for form, or use a timer to re-draw.
Reply With Quote
  #3  
Old 04-12-2006, 08:21 AM
Chesso Chesso is offline
Senior Member
 
Join Date: May 2004
Location: Sydney, Australia
Posts: 1,199
Default RE: Canvas.

Oh yeah and setting the DoubleBuffered property to True may help also.
Reply With Quote
  #4  
Old 04-12-2006, 08:22 AM
AceOmega AceOmega is offline
Senior Member
 
Join Date: Sep 2004
Posts: 2,393
Default RE: Canvas.

Who's Cnavas are you Drawing on and when are you doing it?

If you do it on the Objects "OnDraw" event then it will stay because this event will fire every time the object is refreshed.
Reply With Quote
  #5  
Old 04-12-2006, 08:29 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default RE: Canvas.

The Canvas of the form. I am doing it the "OnShow" event of the form I am drawing shadows for the edit boxes on the form to enhance the looking of the form.

Regards,
Abdulaziz Jasser
Reply With Quote
  #6  
Old 04-12-2006, 08:34 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default RE: Canvas.

It doesn’t help.

Regards,
Abdulaziz Jasser
Reply With Quote
  #7  
Old 04-12-2006, 08:37 AM
AceOmega AceOmega is offline
Senior Member
 
Join Date: Sep 2004
Posts: 2,393
Default RE: Canvas.

Put the code in your OnPaint event.
Reply With Quote
  #8  
Old 04-12-2006, 11:07 AM
adixtopix adixtopix is offline
Senior Member
 
Join Date: Oct 2003
Posts: 730
Default RE: Canvas.

you could make an TImage, and draw on it.
it will not need an onpaint enevt.

and make the image AlClient, to make it as the form

..........................
Sometimes i need help, sometimes i give help.
Adrian Topcea
Reply With Quote
  #9  
Old 04-12-2006, 12:33 PM
AceOmega AceOmega is offline
Senior Member
 
Join Date: Sep 2004
Posts: 2,393
Default RE: Canvas.

Jasser wrote...

"...I am drawing shadows for the edit boxes..."

You might want to read the other posts.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 03:09 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.