 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Chris Miles Guest
|
Posted: Sat Jul 12, 2003 4:51 pm Post subject: Painting to Canvas on every iteration of a while loop not wo |
|
|
My question is: im using c++ builder and using the inbuild BPL stuff for windows applications, I have a while loop which i want to repaint the Canvas object on each iteration.. but when running the loop it freezes until the last iteration and then it repaints... any ideas on how can i get arround this? thanks
|
|
| Back to top |
|
 |
Damon Chandler (TeamB) Guest
|
Posted: Sat Jul 12, 2003 8:23 pm Post subject: Re: Painting to Canvas on every iteration of a while loop no |
|
|
Hi Chris,
| Quote: | I have a while loop which i want to repaint the Canvas object on each
iteration.. but when running the loop it freezes until the last
iteration and then it repaints...
|
How are you repainting the Canvas within your loop?
--
Damon (TeamB)
BCBCAQ - http://bcbcaq.bytamin-c.com
|
|
| Back to top |
|
 |
Damon Chandler (TeamB) Guest
|
Posted: Sun Jul 13, 2003 5:43 pm Post subject: Re: Painting to Canvas on every iteration of a while loop no |
|
|
Chris,
| Quote: | this->paint(m_outputGraphCanvas);
void SOM::paint(TCanvas *Canvas) {...}
|
What does the following show?
ShowMessage(m_outputGraphCanvas->ClassName());
I ask because the solution depends on whether you're drawing to a display
device context (DC) or to a memory DC. If your m_outputGraphCanvas member
is assigned a pointer to a TControlCanvas object (e.g., m_outputGraphCanvas
= Form1->Canvas), then you're drawing to a display DC. If
m_outputGraphCanvas points to a TBitmapCanvas object (e.g.,
m_outputGraphCanvas = Image1->Canvas), then you're drawing to a memory DC.
If you're drawing to a display DC, then the rendering should be visible as
it's executed. If you're drawing to a memory DC, then the results won't be
visible until the bitmap associated with the memory DC is rendered to the
screen. In the latter case, assuming you're using a TImage component,
simply call the TImage::Refresh() method within your loop.
Good luck,
--
Damon (TeamB)
BCBCAQ - http://bcbcaq.bytamin-c.com
|
|
| Back to top |
|
 |
Dumboo Guest
|
Posted: Thu Jul 31, 2003 5:07 am Post subject: Re: Painting to Canvas on every iteration of a while loop no |
|
|
| Quote: | I have a while loop which i want to repaint the Canvas object on each
iteration.. |
It will never work,
I have experienced it,
you have to give time to the canvas to Repaint itself, since u r in a same
Thread you cannot either you have to simulate the while(..) loop using Timer
or run your code through seperate thread
-Dumboo :-)
|
|
| 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
|
|