Announcement

Collapse
No announcement yet.

RTF Speed

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • RTF Speed

    With all the emphasis on RTF when dealing with friendly URLs, wide characters and inline images in a RichEdit control, it feels like I ought to have a strategy of some kind, such as using RTF at all times. But not all apps use functions that require RTF-level modifications so for now I guess whether to use plain text or RTF is just on a case-by-case basis.

    But I do have a question that might affect the answer.

    Is the use of STREAMIN significantly faster at loading text than doing something like Control Set Text? If I want to load 10MB of text into a RichEdit control, is there an approach that offers noticeably faster display of the content?

  • #2
    Gary,

    With just a tinge of cynicism here, RTF and SPEED don't live in the same universe. RTF is not only a lot larger than plain text but it must be decoded for display and this makes it slow. Use the STREAMIN and OUT as it is faster than loading text into memory and then pasting it into a rich edit control. Using riched 3 you can easily load > 100 mb and in 64 bit about 750 megabytes as plain text.

    The trick with RTF is to load small pages but have many of them.
    hutch at movsd dot com
    The MASM Forum

    www.masm32.com

    Comment


    • #3
      I would agree with George Bleck in post t#20 about using html with many more options.
      https://forum.powerbasic.com/forum/u...ng-line-colors

      Thread on RichEdit goes way back to 2009 and seem to be related.
      https://duckduckgo.com instead of google

      Comment


      • #4
        Q> "If I want to load 10MB of text into a RichEdit control, is there an approach that offers noticeably faster display of the content?"

        The powerfull RTF and speed live pretty well together.

        Comment


        • #5
          @Gary,

          In RichEditCtrl.inc you have two functions, RichEdit_LoadRtfFromFileA and RichEdit_LoadRtfFromFileW, ready to use.
          Forum: http://www.jose.it-berater.org/smfforum/index.php

          Comment


          • #6
            Originally posted by Mike Doty View Post
            I would agree with George Bleck in post t#20 about using html with many more options.
            https://forum.powerbasic.com/forum/u...ng-line-colors

            Thread on RichEdit goes way back to 2009 and seem to be related.

            I'm still trying to figure out why Gary ghosted me in this post in that thread
            <b>George W. Bleck</b>
            <img src='http://www.blecktech.com/myemail.gif'>

            Comment


            • #7
              Hey George!

              What does ghosted mean?

              Comment


              • #8
                Trying to ignore or hide from me :-)

                All in good humor mind you. Not taking it serious either way.
                <b>George W. Bleck</b>
                <img src='http://www.blecktech.com/myemail.gif'>

                Comment


                • #9
                  Hey Pierre!

                  Thanks for the link! That's right up the I-can-test-it alley. I just hadn't heard that the STREAMIN provided such a response.

                  Loading an RTB with megabytes of text can easily freeze the control for several seconds. EM_STREAMIN allows for responsiveness almost instantaneously while the data is still being streamed into the control.
                  In one of my apps I've noticed a second+ delay in loading plain text, especially when the font is large (discussed in another thread). I've wondered about it but never really gave it much attention.

                  I've also noticed a delay in loading large files into a RichEdit, where I want the text to be other than black and white. The text loads black, then converts with a noticeable delay.

                  I'll do a test to see if STREAMIN ca reduce the lags I've seen.



                  Comment


                  • #10
                    hi George,
                    I think there must have been another thread that pointed out something stupid I had done, counter to your advice.I think I was trying to hide from the embarrassment you would have rightly caused me for my mistake.

                    Let's go with that story!

                    Comment


                    • #11
                      Jose!
                      Yes, I saw the functions. Normally, I like my files to be plain text so that I can manually edit them in a clinch. But if I find that loading a large file with STREAMIN gives a better user experience, then I could be convinced otherwise and your functions would fit the bill. I'll be experimenting with it this week.

                      Comment


                      • #12
                        Jose,
                        I was looking through your include files for a way to enumerate links in a RichEdit but didn't see anything.

                        I can always parse the content myself, but if the RichEdit already supports link enumeration, returning an ENLINK structure for each link, then it would be a handy tool to have.

                        Comment


                        • #13
                          I don't know of any function that enumerates them.
                          Forum: http://www.jose.it-berater.org/smfforum/index.php

                          Comment


                          • #14
                            Jose,
                            Thanks for responding. My net search failed to find anything but it wouldn't be the first time you've pulled a rabbit out of the hat!

                            Since the RichEdit RTF string appears to include the term "HYPERLINK" in front of all active URLs that it detects, it may be easier for me to extract links from the RTF string instead of from the plain text. I'll take a look at that.

                            Comment


                            • #15
                              Gary,

                              This is in standard RTF.

                              1. <\\www.yoururl.com#My Link>

                              2. hide the double "\\", URL and # character. <My Link>

                              3. set the two angle brackets to your background colour. My Link

                              At the processing end remove the double "\\" and only read up to the # character.

                              Process the link however you like.

                              I already have this going with a hyperlink engine, works great.
                              hutch at movsd dot com
                              The MASM Forum

                              www.masm32.com

                              Comment


                              • #16
                                Gary, a detail to not forgot is that if your application could run on multiple Windows version then Windows 10 need a "HYPERLINK " ending with a space as Windows 7 RichEdit 4.1 do, except "HYPERLINK" will also work on the later.

                                Comment

                                Working...
                                X