Image Rendering with QGraphics Framework
-
Hello,
I am currently displaying audio waveforms and spectrograms in my app and I need to be able to zoom in and out of these images and have the best possible resolution in each level of zoom. For the display I am using the Qt Graphics Framework.
I am a bit lost on how to approach this problem, I think that I have to keep several images of different zoom levels in memory and change them according to how much I zoom in ..? What is the proper way of tackling this issue?
Any guidance or tips for what would be the best Qt tools or methods to use to get started I would really appreciate it.
Thanks.
-
You should check the QGraphicsPathItem. Provide a QPainterPath for your waveform, it will be repainted appropriately for the different zoom levels. QPainterPath turn out to be pretty fast. I don't know however if this item has some caching for different path approximations for different zoom levels but you could probably implement that if it does not exist.