bar
2007-06-26 15:14:13 UTC
Hello all
I am using BCB6.
In the form paints event i have
TPicture *g = new TPicture();
g->LoadFromFile(strG);
for(int y = 0; y < (frmMain->Height); y += g->Height)
{
for(int x = 0; x < (frmMain->Width); x += g->Width)
{
frmMain->Canvas->Draw(x, y, g->Graphic);
}
}
So i am tiling a graphic on the form. Everything is fine.
I am moving a panel on this form in a timer with the interval 25 milli
seconds, so there the form paint event occurs frequently.
The panel is scrolling and the form is repainting but after 1 or 2 minutes i
get an exception
"Canvas does not allow for drawin".
I searched and find that the Cavas handle should have device context, but i
am not creating any canvas dynamically, i am using the forms canvas.
How to resolve the problem
Thanks for the suggestions
SA
I am using BCB6.
In the form paints event i have
TPicture *g = new TPicture();
g->LoadFromFile(strG);
for(int y = 0; y < (frmMain->Height); y += g->Height)
{
for(int x = 0; x < (frmMain->Width); x += g->Width)
{
frmMain->Canvas->Draw(x, y, g->Graphic);
}
}
So i am tiling a graphic on the form. Everything is fine.
I am moving a panel on this form in a timer with the interval 25 milli
seconds, so there the form paint event occurs frequently.
The panel is scrolling and the form is repainting but after 1 or 2 minutes i
get an exception
"Canvas does not allow for drawin".
I searched and find that the Cavas handle should have device context, but i
am not creating any canvas dynamically, i am using the forms canvas.
How to resolve the problem
Thanks for the suggestions
SA