Код: Выделить всё
void __fastcall TFillScreenForm::CaptureToBitmap(Graphics::TBitmap * Bitmap)
{
if (Bitmap)
{
Bitmap->SetSize(FillLayout->Width, FillLayout->Height);
// Create a canvas for the bitmap
TCanvas* Canvas = Bitmap->Canvas;
// Begin drawing on the canvas
TRectF Rect(0, 0, Layout->Width, Layout->Height);
if (Canvas->BeginScene())
{
try
{
// Clear the canvas
Canvas->Clear(TAlphaColors::Null);
// Render the layout onto the canvas
Layout->PaintTo(Canvas, Rect);
}
catch (...)
{
// Handle any exceptions if necessary
}
// End the drawing scene
Canvas->EndScene();
}
}
}
И вот захваченный растровый карту. Class = "Lang-None PrettyPrint-Override"> Bitmap->SetSize(Layout->Width, Layout->Height);
Bitmap->Assign(Layout->MakeScreenshot());
< /code>
Оба захватывают только графику, а не txet. Мне нужно использовать txet, так как я хочу, чтобы его большая гибкость.
, чтобы убедиться, что это не так, что я не могу добавить Text Offe At's Offe Aboude. в растровом карте, но правильно отображается в форме.
Подробнее здесь: https://stackoverflow.com/questions/796 ... ding-ttext