Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I zoom and span a bitmap in a CWGraph ?

How can I display a bitmap and attach it to a CWPlot of a CWGraph, such that zooming or spanning will affect CWPlot and the bitmap together ?
0 Kudos
Message 1 of 3
(3,406 Views)
The feature you are inquiring about does not exist in the CWGraph control. Panning and Zooming the PlotArea in CWGraph does not affect the PlotAreaImage at all.

However, you could possibly programmatically catch the mouse events on the PlotArea and work with the CWGraph.PlotAreaImage.CWImage.AnimateColumns/AnimateRows attributes to run through different frames of the bitmap to make it look like it is zooming in on the bitmap. I've tried this myself and it seems to only be effective on a bitmap with a repeating pattern (I used a checkerboard pattern), because no matter where you go on the bitmap it looks the same, and increasing the number of animated columns and rows creates a zooming effect. The one problem with using a non-repeating pattern bitmap and this tech
nique is that you can't control where the animation stops or reference a certain animation column and row to represent the area on the bitmap you want to zoom in on. So in short this probably won't do much for you, but it is most likely the only option you have. To see an illustration of how the CWImage.AnimateColumns/AnimateRows attributes effects a CWImage object take a look at the MeasurementStudio\VB\Samples\UI\Button\Simple Button\Button.vbp example program and pay special attention to the command button with the doughnut image on it.

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 3
(3,406 Views)
This workaround does not solve my problem because I need the bitmap to stand near a particular plot, even when zooming or panning ...
Anyway, thanks for your quick answer
0 Kudos
Message 3 of 3
(3,406 Views)