I've got a TForm which has an Event FormResize
, within that function I want to draw something within my TImage.
My FormResize function looks like below
void __fastcall TForm1::FormResize(TObject *Sender)
{
// Teken de blokjes
_viewPort->draw(_viewPortImage->Canvas, _viewPortImage->Width, _viewPortImage->Height);
}
Within this function I do nothing more than drawing a rectangle which draws a border:
ViewPort::draw(Vcl::Graphics::TCanvas* Canvas, int width, int height)
{
Canvas->Rectangle(0, 0, width, height);
}
Now the problem. When I make the form smaller than the original it scales well. but when the form gets bigger than the original size. The background + Border is not drawn well. See the screenshot below. The white background / Canvas is from the TImage. The TImage is Anchored in all 4 directions.
Anyone knows how to also make the image able to resize bigger?