Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the background bitmap of CNiGraph

I used the project from NI support that contains the class CScaleBmpPlotAreaGraph. That project was very helpful and I was able to do exactly what I wanted to do. However, I found a problem with it and I was wondering if you knew why this was happening?

I want to draw what we call a LOFAR spectra to the background bitmap of the CNiGraph. Each pixel is a spectral color intensity from 0-255 grey-scale. Using your class I discovered how to get the handle to the bitmap. Once I got the handle I used SetBitmapBits (CBitmap) to fill the bitmap. This worked perfect and was super fast (10ms for 1600/240 pixels). To test it I was adding a line of data (1600 points) every 100ms. Each line was the SAME value, say, 128, all
the way across the 1600 points. So that line would be middle grey. I would shift the data up in the array, lose the first line and then add a new line at the bottom and then using BitBlt to send that new 1600/240 array(looks like scrolling upward). That next line would increment by one and so on repeating and resetting back to zero after 255. The whole bitmap looks like a scrolling gradient. Still ran very fast. The problem occurs now that I started sending it random data. Each pixel across each 1600 point line being a random value (salt and pepper speckeled looking). Now the it takes 600+ ms for the graphics to complete!

Why is that?

Scott

Windows XP, Pentium IV 1.8G
Download All
0 Kudos
Message 1 of 1
(2,986 Views)