Results 1 to 4 of 4

Thread: setting one value transparent in QwtPlotSpectrogram

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2009
    Posts
    92
    Thanks
    7
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default setting one value transparent in QwtPlotSpectrogram

    Hi all,
    I am using QwtPlotSpectrogram to display two raster 'maps' (great library btw).
    The bottom layer spectrogram is a gray scale shaded relief map of a landscape and the top map is information from a water balance calculation in a blue colors from light blue to darkblue using QwtLinearColorMap. I would like the value 0 of the top layer spectrogram to be totally transparent (alpha = 0) and the blue values to be partially transparent (for instance alpha = 200). This top layer changes every few seconds because a model in a different thread does water balance calculations so the information is renewed every model run and the spectrograms are redrawn:
    - fill a vector with relief data,
    - attach the gray scale colormap
    - replot and rescale the QwtPlot
    - fill a vector with 'water data'
    - attach a blue palette colormap
    - replot and rescale the QwtPlot
    - next model run

    I hope I can make myself clear! I can attach code but its rather a lot. Basically I follow the spectrogram example.

    I have tried setting the alpha value in QwtLinearColorMap but that has no effect and I have tried setAlpha(int) of the QwtPlotSpectrogram but that makes the spectrogram more grayish but not transparent (and is anyway not what I want).
    There is also QwtAlphaColorMap but I don't understand how to link that to the spectrogram or the colormap.

    thanks for any help

    Victor
    Last edited by qt_gotcha; 12th May 2012 at 08:54.

Similar Threads

  1. Google map on QwtPlotSpectrogram
    By sagittager in forum Qwt
    Replies: 4
    Last Post: 15th October 2011, 15:32
  2. Replies: 2
    Last Post: 16th June 2011, 10:56
  3. Replies: 8
    Last Post: 17th April 2011, 17:16
  4. Replies: 0
    Last Post: 25th August 2010, 17:39
  5. Replies: 9
    Last Post: 3rd December 2009, 18:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.