C++ Builder 10.2 Tokyo > FastReport > TfrxLineViewer로 선 그리기 > performance: 20만 그리기는 불가능
8652 단어 성능FastReportcppBuilder
RAD Studio 10.2 Tokyo Update 3
Fast Report VCL 5
개요
참고
4개의 빨간색 선을 그리는 구현 예(단, 러시아어)
htps //w w. 훗 st 레포 rt. 루 / 루 / 후루 m / 어서 x. php? 쇼 w와 피 c = 8995
Delphi 코드를 참고로 C++ Builder에서의 구현을 검토했다.
구현
Unit1.h
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include "frxClass.hpp"
#include "frxExportPDF.hpp"
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE で管理されるコンポーネント
TfrxPDFExport *frxPDFExport1;
TfrxReport *frxReport1;
TButton *Button1;
void __fastcall frxReport1BeforePrint(TfrxReportComponent *Sender);
void __fastcall Button1Click(TObject *Sender);
private: // ユーザー宣言
public: // ユーザー宣言
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
Unit1.cpp
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "frxClass"
#pragma link "frxExportPDF"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::frxReport1BeforePrint(TfrxReportComponent *Sender)
{
static TfrxLineView *lines[200];
for(int idx=0; idx < 200; idx++) {
lines[idx] = new TfrxLineView(Sender);
lines[idx]->SetBounds(10, 10 + idx * 3, 30, 2);
lines[idx]->Printable = true;
lines[idx]->Frame->Color = clRed;
lines[idx]->Frame->Width = 2;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
frxPDFExport1->FileName = L"test.pdf";
frxPDFExport1->ShowDialog = false;
frxReport1->PrepareReport(true);
frxReport1->Export(frxPDFExport1);
}
//---------------------------------------------------------------------------
실행 예
생성된 PDF 파일 캡처.
녹색 선은 원래 FastReport의 디자이너에서 직접 추가한 것입니다.
빨간색 선이 동적으로 추가한 선입니다.
(200개를 아래쪽으로 밀어 넣으면서 추가)

성능
200개의 선을 그렸지만 200개를 넘으면 처리가 굳어지게 되었다.
FastReport에서 TfrxLineView를 동적으로 추가하는 개수로는 200개 미만이 될 것 같다.
20만 그루의 묘화는 무리라고 알았다.
Reference
이 문제에 관하여(C++ Builder 10.2 Tokyo > FastReport > TfrxLineViewer로 선 그리기 > performance: 20만 그리기는 불가능), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/7of9/items/2d16bfe53196ddddf59a텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)