Re: Plot bitmap lines
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Mon, 06 Nov 2006 21:05:06 -0500
I was faced with a similar problem some years ago. Too much data, not enough space.
First, I was getting the data not as realtime data but as a file, so there would need to
be a variation on this theme, but here's what I did, sort-of-readapted to your problem
statement.
What I did was to note that my lines, which had a range of up to 16K (rather than 1280)
had long runs in them. It wasn't "true grayscale". Also, I had only an 800x600 typical
user window size. So I did a data reduction, encoding the data as run-encoded
information, but which could generate no better resolution than my window had. I then
wrote this out to another file. As I generated each line, I recorded where in the
intermediate file I had written its reduction. All I had to do was keep the data in
memory that was actively being displayed, and it was in compressed format (by the way,
this was all done in Win16), so all the OnPaint handler had to do was to regenerate the
display from this compressed information, which was done with quite acceptable
performance. I did optimize performance by prefetching a second window's worth of data,
so that forward scrolling could proceed reasonably quickly for 'page' sized scrolls (where
a 'page' was 1/4 of a window in that system, customer's decision). If the user scrolled
backward, I had the compressed data already in the file, and only had to
seek/read/decompress to recreate it. A distant forward scroll did tend to be slow, but
you can eliminate that problem by either keeping a cached copy of the reduced data or by
being able to seek/read as needed.
This was actually my first MFC program because it required a vertical splitter window so
two different waveform-representations could be scrolled over each other and compared, and
I knew MFC had a splitter view.
To scroll quickly, use ScrollWindow, and then have your OnPaint handler be smart about the
invalidated rectangle (only redraw the actual-invalidated area, not the whole client area,
for maximum performance). This will give the illusion of very fast, low-flicker
scrolling, under most conditions.
joe
On 3 Nov 2006 11:46:59 -0800, ronnie.turrentine@xxxxxxxxx wrote:
I'm looking for help in displaying line data (1280x1 grayscale) inJoseph M. Newcomer [MVP]
either a bitmap or plot.
Basically I'm receiving lots of 1280x1 lines in real time and I need to
display this data along the Y axis. The X axis then become time.
There is potential 1GB of data (800k lines) but I certainly don't want
to keep that much in memory.
The real time data will then be saved to file to be displayed in the
same fashion later. Of course then we will know the number of lines
ahead of time.
Any help in displaying either the real time data or file data would be
appreciated.
I know I can easily make a bitmap from the 1280x1 data and rotate the
display or create the bitmap using a loop to store column data. It
needs to be fast though. The idea is that the use can scroll through
all of the data with the horizontal scroll bar. I'm not against using
a slider either.
I'm am using MFC SDI app (doc/view) and a dialog for the real time
data. The file data will be displayed in a CView based class or
whatever will work.
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- Plot bitmap lines
- From: ronnie . turrentine
- Plot bitmap lines
- Prev by Date: Re: strcpy not work in Unicode mode
- Next by Date: Re: CTreeCtrl EditLabel
- Previous by thread: Re: Plot bitmap lines
- Next by thread: AfxGetApp() return NULL in CALLBACK function.
- Index(es):
Relevant Pages
|
Loading