Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use CWPictureDisp of Measurement Studio in VB ?

Is there an example of using the CWPictureDisp object
of ComponentWorks/Measurement Studio in Visual Basic?

I am developing a display for a system that will track
an underwater vehicle and I would like to show a
vehicle shaped icon that would move around on an XY
plot.

The only help information for CWPictureDisp I could
find just says it manipulates images within controls.
But I can find no examples or detailed description
of how to use it.

I would greatly appreciate if someone could provide
more detailed information on the CWPictureDisp
or tell me where to look for the information?

Thanks.
0 Kudos
Message 1 of 2
(3,373 Views)
The easiest way to do this is using the new Annotations feature in the 2D Graph. An annotation object in the graph consists of a shape, an arrow, and some text. In your case, you want to hide the arrow and the text and use an image for the shape.

Here is how you can play around with this idea.
1. Right-click on the 2D Graph and select Properties.
2. On the Annotations property page, click Add to add a new annotation. If you like, you can rename the annotation to 'vehicle.' This would be useful when programmatically accessing the annotation.
3. On the Style sub-page, click on the Picture icon. This is a shortcut method of setting several styles on the annotation for an image only.
4. On the Coordinates sub-page, choose Plot-1 (or whatever the name of your pl
ot is) for Plot and Point On Selected Plot for Snap Mode. This tells the shape to snap to a specific point on a specific plot.
5. On the Images (top-level) property page, select the name of your annotation in the list, click the button to the right of File or URL, and select Load. Find the image of the vehicle you want to use.
During run-time:
6. Programatically change the PointIndex property on the annotation object to move the shape's position on the plot.

Remember to use the ?-help feature on the property pages to see example VB code that uses the properties.

I hope this helps,
David
0 Kudos
Message 2 of 2
(3,373 Views)