CodePudding user response:
10 m is more than 1000 bytes, and a half discount have to more than 500 words, the user can see come over?CodePudding user response:
The principle of demon elder brother, I know about, is not loading all the data came in, the user viewing area to display the data line, but how to use the code processing, demon elder brother give me a ballpark genuflect is begged direction.CodePudding user response:
Can put all the data in memory (but not the full display), calculation shows how many data to a page, according to the current position of the scroll, calculate the current need to display the data in the 10 MB data migration, and displayedCodePudding user response:
Demon elder brother, isn't me to want to intercept richedit scroll event, and then in the event processing?CodePudding user response:
Show only one panel data, it is estimated that at most a few k, will be a lot faster,Can need not richedit, with their own scroll bar,
CodePudding user response:
If the storage is saved text format, more good, if it is a rich text format to do perfect display difficulty bigGuess the host's demand, make the novel reader class program may be, use memo or production pictures
CodePudding user response:
The simpler production picturesCodePudding user response:
Can you tell me the production images specific to do? I only need to display content, don't need to worry about style?CodePudding user response:
Have a problem, the picture isn't that cannot be edited later, so may still need to display the text content, but my problem is my own Memo scroll event, when dragging down the scroll bar to load content, but at the time of loading content, Memo according to the content and the scroll bar sliding incoherent, how?CodePudding user response:
Different scroll bars can be synchronized, but there is no need to synchronizeYou first memo of the scroll bar is hidden, so the scroll bar synchronization is not synchronous, it has nothing to do
Key point is that you want a separate plugin scroll bar control, and then work out how much your text lines, corse scroll bar is set to the corresponding number of rows, then the current row in the scroll of the scroll bar event number by the number of characters in a row, and then the interception according to
CodePudding user response:
To edit, also want to through calculation, the change of replacement content into memory, otherwise go back to the display content is still the originalCodePudding user response:
Image with image, and then have the API to calculate line on the canvas of the width and height, and set up line spacing, and then use the canvas painting method of text, the canvas can set the font and size, etc., this is all the text edit control bottom is such implementationThat is so things are painted on the screen
CodePudding user response:
Scroll for large amounts of data is a standard solution.Their implementation aside, of course, is also very simple.
In BCB, there are at least two simple scheme to achieve.
For simple applications available TListBox, for complex applications available TListView.
For more personalized applications, TListBox, TListView well with graphic support.
The TListBox, for example, article 1 million, 140 m byte data displays .
//put a Button on the Form, put a TListBox.
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
TList * dList=NULL;
Void __fastcall TForm1: : Button1Click (TObject * Sender)
{
ListBox1 - & gt; Style=lbVirtual;//ListBox to virtual,
If (dList==NULL)
DList=new TList ();//data stored in the TList
Char strLine [512].
Int size=0;
for(int i=0; i<1000000; I++)//to add data to the dList
{
Int len=0;
for(int j=0; J<16. J++)
Len +=wsprintf (strLine + len, "08 x %", I + j).
Char * TMP=new char [len + 16];
The size +=wsprintf (TMP, "% d % s", I + 1, strLine);
DList - & gt; Add (TMP);
}
ListBox1 - & gt; The Count=dList - & gt; The Count.//the number of synchronous TList and dList
Caption=the size/(1024 * 1024);//calculation data size
}
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Void __fastcall TForm1: : ListBox1Data (TWinControl * Control, int Index,
AnsiString & amp; Data)
{
Data=https://bbs.csdn.net/topics/(char *) dList -> Items [Index];//display the data in the current window
}
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --