473,487 Members | 2,711 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Priting a full screen on text, character by character

Everyone,

I am having a problem with perfromance and the drawing of strings on a
panel control and I am hoping you all can help or at least provide me
with some good reference material. Here is what I am doing:

I am using C# 2003 and reading into a file in real-time and as I scroll
a scrollbar control, I am grabbing the bytes, converting them to chars,
calculating the number of visible lines and creating an array of strings
(not in the pain event) and then displaying them on a panel control by
overriding the on-paint method on the panel control and looping the
array of strings then drawing them to the panel. This has proved to be
extremely fast and efficient even with 700MB files and having the
control at full-screen size. My problem is that I want to allow the
multiple coloring of characters and be able to retain the speed that I
have. If I remove the line calculation portion of my code and render the
entire panel character-by-character in the onPaint event, I find that
there is much lag when trying to draw the characters one by one and
apply a color style.

Does anybody have any ideas on how I can render say, 7000 individual
characters on a control and be able to scroll it (7000 new characters
each time) without any lag by using either .NET's GDI+ or mabye even
just GDI? I am currently using DrawString and the OnPaint event and have
even tried drawing to a memory bitmap and just having the OnPaint event
render the bitmap when scrolling. The only problem with the latter
method is that rendering an image of 1024x768 a few hundred times in a
second or so is even slower than drawing the character one at a time.

Any help here?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
2 1774
Well, a simplest optimization would be to split the text into chunks having
the same color and draw the text chunk-by-chunk instead of
character-by-character.
It also sounds a bit strange using the off-screen bitmap is that slow.
Ensure you don't use the stretch mode and that the bitmap has the same pixel
format the screen has.

"jonny" <jo*********@nospam.com> wrote in message
news:eL**************@TK2MSFTNGP10.phx.gbl...
Everyone,

I am having a problem with perfromance and the drawing of strings on a
panel control and I am hoping you all can help or at least provide me
with some good reference material. Here is what I am doing:

I am using C# 2003 and reading into a file in real-time and as I scroll
a scrollbar control, I am grabbing the bytes, converting them to chars,
calculating the number of visible lines and creating an array of strings
(not in the pain event) and then displaying them on a panel control by
overriding the on-paint method on the panel control and looping the
array of strings then drawing them to the panel. This has proved to be
extremely fast and efficient even with 700MB files and having the
control at full-screen size. My problem is that I want to allow the
multiple coloring of characters and be able to retain the speed that I
have. If I remove the line calculation portion of my code and render the
entire panel character-by-character in the onPaint event, I find that
there is much lag when trying to draw the characters one by one and
apply a color style.

Does anybody have any ideas on how I can render say, 7000 individual
characters on a control and be able to scroll it (7000 new characters
each time) without any lag by using either .NET's GDI+ or mabye even
just GDI? I am currently using DrawString and the OnPaint event and have
even tried drawing to a memory bitmap and just having the OnPaint event
render the bitmap when scrolling. The only problem with the latter
method is that rendering an image of 1024x768 a few hundred times in a
second or so is even slower than drawing the character one at a time.

Any help here?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 16 '05 #2
Thanks,

I will check into that and keep this thread posted with what i come up
with

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
105739
by: Dave | last post by:
Hi, I have done some research, trying to Clear The Screen in java code. The first option was the obv: system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n"); then i heard about this method:...
2
3351
by: Paul | last post by:
Try making a .html file with only this inside: <script> op=window.createPopup(); op.document.body.innerHTML="">"; op.show(0,0,screen.width,screen.height,document.body); </script> As you it...
9
12276
by: pow67 | last post by:
Is there a javascript statement which can be incorporated in a hyperlink which will open a new page that fills the screen while leaving the page with the link open? Thanks in advance. CW
6
5590
by: Tony Liu | last post by:
Hi, when switched to the full screen mode in VS.NET IDE, is there any way to hide the main menu bar? Thanks Tony
1
2294
by: Angus Lepper | last post by:
I'm writing a stock ticker for a stock market simulation, and can load the data into the xmlreader in the first place, but can't figure out how to refresh/update the data in it. Any ideas? Code:...
1
6617
by: linuxnooby | last post by:
Hi I am trying to write a python script to run on windows xp that will have a full screen gui. The script has a function that creates a full screen (hides task bar) top level window using...
1
4830
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was...
4
5444
by: Neil | last post by:
Just found out that the Microsoft Rich Textbox does not support full text justification, since it's based on Version 1.0 of the RichEdit Window Class, and full text justification is only available...
8
5083
by: Sham | last post by:
I am trying to perform the following query on a table that has been indexed using Full Text Search. The table contains multiple columns than have been indexed. (Below, all xml columns are...
0
7106
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7349
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5442
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1381
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
600
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.