Hi, I'm trying to place a control of some sort on my window which will display a waveform trace in it, with a horizontal scrollbar at the bottom. What is the best way of doing this? I tried subclassing a static control except that a static control doesnot recieve input notification like WM_LBUTTONDOWN, etc... Any ideas? Thanks, Ben
Posted on 2000-11-28 23:13:00 by cyberben
Ben, About the only way you will do what you are after is to run a memory device context, draw your wave form onto it and then BitBlt() it onto the display area you require. If your complete waveform is larger than the screen which is probably the case if you need to scroll it from one side to another, you will need to get the part of the bitmap in the memory device context and blit it onto the screen in relation to the scrollbar position. To make it a "persistent bitmap", you will need to display it from the WM_PAINT message. Regards, hutch@pbq.com.au
Posted on 2000-11-29 01:36:00 by hutch--
Yah I tried something similar to that but had some repainting problems. When you create a control, you are guarenteed to get the painting order correct and perfect... But I'll try that again. I didn't use a device context, I just drew it directly, but if I simply draw the wave form once as a long device context I can blit any section I want.... that may just work! Thanks, Ben
Posted on 2000-12-01 23:32:00 by cyberben
Thanks hutch I got it to work! My main problem with the repaint was that it was leaving "residue" of the last repaint job... I fixed that with one call to "InvalidateRect" to invalidate the entire window so everything gets painted now! Which is fine because I would have repainted everything anyhow... Thanks again, Ben
Posted on 2000-12-02 01:24:00 by cyberben