Hello,
I would like to ask you for ideas. My task is drawing a spectrogram in a window. The attached picture shows an example spectrogram. Such spectrograms are used for visualizing FFT spectra over time. It has a vertical time axis and a horizontal frequency axis. The amplitudes of the spectra are color-coded. Each horizontal dot line corresponds to one FFT. From the bottom of the window newly calculated spectra are shifted in while the oldest spectra on top are shifted out. I already have a solution for drawing a line of colored dots. My question is: How can I manage the FIFO-like vertical shift of the window content?
I cannot recalculate the complete spectrogram each second because of computing power and, mainly, because I can only save the input data of the last row. The previous dot lines can only be held in the frame buffer.
Best regards
Jan
P.S.: I was thinking of something like:
1. Drawing one row of dots at the bottom of the window
2. Shifting the window 1 row up (e.g. WM_SetWindowPos)
3. Removing 1 row at the top
4. Attaching 1 row at the bottom (e.g. WM_SetYSize)
5. Drawing one row of dots at the new bottom of the window ...
Step 3 seems to be the problem here. I don't know how to cut off the upper row. Vertical resizing only affects the bottom side of a window.
I would like to ask you for ideas. My task is drawing a spectrogram in a window. The attached picture shows an example spectrogram. Such spectrograms are used for visualizing FFT spectra over time. It has a vertical time axis and a horizontal frequency axis. The amplitudes of the spectra are color-coded. Each horizontal dot line corresponds to one FFT. From the bottom of the window newly calculated spectra are shifted in while the oldest spectra on top are shifted out. I already have a solution for drawing a line of colored dots. My question is: How can I manage the FIFO-like vertical shift of the window content?
I cannot recalculate the complete spectrogram each second because of computing power and, mainly, because I can only save the input data of the last row. The previous dot lines can only be held in the frame buffer.
Best regards
Jan
P.S.: I was thinking of something like:
1. Drawing one row of dots at the bottom of the window
2. Shifting the window 1 row up (e.g. WM_SetWindowPos)
3. Removing 1 row at the top
4. Attaching 1 row at the bottom (e.g. WM_SetYSize)
5. Drawing one row of dots at the new bottom of the window ...
Step 3 seems to be the problem here. I don't know how to cut off the upper row. Vertical resizing only affects the bottom side of a window.
The post was edited 4 times, last by JanBurg ().