Нет.
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено /гоша/ 01 сентября 2004 г. 14:03
В ответ на: Согласен отправлено vvvv 01 сентября 2004 г. 13:40

//---------------------------------------------------------------------------
void __fastcall TForm1::PaintBox1Paint(TObject *Sender)
{PaintBox1->Canvas->Lock();
PaintBox1->Canvas->Draw(0,0,Image1);
PaintBox1->Canvas->Unlock();
return;
}
Насколько дело м.б. в библиотеках Builder++ 5 vcl50.bpl стоит ли пробовать искать/ ставить более свежий Buider ++?
Спасибо.

When you do custom drawing, such as shown in the code for the Button's OnClick event handler below, this drawing will not be persistent and will be "erased" the first time a WM_PAINT message is received and processed the PaintBox component.

void __fastcall TForm1::Button1Click(TObject *Sender)
{
PaintBox1->Canvas->Brush->Color = clRed;
PaintBox1->Canvas->FillRect(PaintBox1->Canvas->ClipRect);
PaintBox1->Canvas->Ellipse(0,0,100,100);
}

In order for the drawing to be persistent, you need to also include an OnPaint event handler that tells the PaintBox how to redraw itself when it needs to. In the code below, an ellipse will be drawn everytime the PaintBox processes a WM_PAINT message, but the PaintBox will only paint the client area of the control red after the Button is clicked. This client area will only stay red until it is invalidated, but the ellipse will persist. This behavior is different from the TImage component, because the TImage component maintains an internal bitmap that stores this drawing information for you.

void __fastcall TForm1::PaintBox1Paint(TObject *Sender)
{
PaintBox1->Canvas->Ellipse(0,0,100,100);
}

Составить ответ  |||  Конференция  |||  Архив

Ответы



Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru