我将图像绘制到画框的函数从 2 个位置调用,如果从 TPagecontrol pagechange 调用它可以正常工作,但如果从 form.formresize(….) 调用,图像被绘制,但随后画框被重新绘制变得完全变白。不知道这个恶行来自什么顺序——
procedure TForm.FormResize(Sender: TObject);
begin
// frist image shown and then re painted white ???
PaintImage2PaintBox(……….);
end;
procedure TForm.pgc_mainmenuChange(Sender: TObject);
begin
// works fine as expected after pagecontrol tab change
PaintImage2PaintBox(……….);
end;;
procedure PaintImage2PaintBox(……….);
begin
/// draw into a PaintBox
end;