Re: GDI+ Custom Control



OK, the way to do this is as follows:


I have actually done this already; my first MFC program was a medical data display and I
had to optimize scrolling on a 20MHz 386.

First, I would treat each of the "tiles" as being a separate window, each a child window
of the overall graph. This simplifies a lot of the comptuations. I did it by using
splitter windows and having (to use your examples) a heart rate view, a blood pressure
view, etc., one per split window. Today, I might consider using a CFormView and using
distinct child windows (custom CStatic with OnPaint handlers) because of the problems I
had in getting all the windows to scroll in synchrony (the WM_HSCROLL messages were sent
only to the active splitter view)

You have the data with some kind of position information (time stamp, sample # count,
etc.)

You have displayed samples from Tn...Tm for n and m being some indicator

You scroll the tile. To do this, you would use ScrollWindow. This will call
InvalidateRect on the exposed rectangle.

OnPaint is called. I used DPtoLP on the invalidation rectangle to compute the Tm..Tk
range that needed to be plotted, and plotted only that part.

To speed up the plot, what I did was scan the input data (4 megasamples) and do a data
reduction so I had no more points to plot than screen resolution. So if I had to plot the
entire 4 megasamples on an 800-pixel box, I would compute the max and min over 5000
samples and draw a vertical line min..max at the corresponding Ti position; the sample "i"
on the screen represented 5000 samples. Doing this with PolyLine made it go even faster.

joe

On Wed, 1 Apr 2009 16:11:32 +0100, "fallenidol" <fallenidol@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:

Hello,

I am currently beginning development of a custom charting control which
shall be used to display medical trend data such as Heart Rate and Blood
Pressure etc. The control will be made up of several horizontal "tiles"
which run the width of the control. So there would be one "tile" for Heart
Rate (say 150px high) and another "tile" below that for Blood Pressure (also
150px). To complicate matters each title needs to "scroll" in a manner
similar to Google Maps. In other words when a title is scrolled horizontally
the chart needs to start constructing images of the graph and buffering them
behind the scenes since redrawing the whole "tile" in real-time would be too
slow.

I'm kind of struggling to think of the best way to implement this so any
suggestions would be helpful. I'm unsure if i need to have just one
usercontrol and use gdi+ to draw everything inside the one control or
whether i should have have one usercontrol as a container and then have
several other usercontrol inside i.e one for each "tile".

I hope this makes sense and look forward to any suggestions you might have.

Thanks.

.



Relevant Pages

  • Re: Plot bitmap lines
    ... but which could generate no better resolution than my window had. ... To scroll quickly, use ScrollWindow, and then have your OnPaint handler be smart about the ... Basically I'm receiving lots of 1280x1 lines in real time and I need to ... display this data along the Y axis. ...
    (microsoft.public.vc.mfc)
  • Re: North Wind Trading data base question
    ... I would like it to display the products in the same window. ... The Northwind Trading database has a form named that under ... >> I would like to use MS Access for are small tile business. ...
    (microsoft.public.access.forms)
  • MSFlexGrid control
    ... If I manually scroll to the right to see the data at the far right of a record, ... window without scrolling back to the left, when I reopen the window the display is showing the far ... Is there code that I can add to cause the display ... to return to the far left of the grid data when the window is opened/closed? ...
    (comp.lang.basic.visual.misc)
  • Re: Split Windows
    ... "Split a window" normally means looking at two different parts of the ... you can only scroll the one your cursor ... If you mean display two documents side by side, ... The tiny toolbar will ...
    (microsoft.public.word.docmanagement)
  • RE: How can we see two different excel sheets on one screen?
    ... Go to Window, and click "compare side by side with..". ... this also gives you the option to scroll simultaneously in both windows... ... > switching back and forth is there a way to display both on my screen. ...
    (microsoft.public.excel.worksheet.functions)