Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Length of Labels on a CWGraph

I'm using valuepairs as labels on a CWgraph. These are set to autosize and can vary wildly in length,
typically 3 to 40 chars. I want to get the size of the the text so that I can adjust other overlaid
components when the plot area resizes as the labels resize.
I have tried doing this by creating a hidden static text with same font as the graph, filling it with
the same text as the label and calling GetTextExtent to get the size of the text.
This nearly works but seems to be out by up to 10-15% with some strings and dead-on with other strings.
Does the graph do anything wierd with the text it uses in labels? Kerning?

Paul
0 Kudos
Message 1 of 2
(3,141 Views)
Hi Paul,

Are you still having the same problem getting the text sizes, or have you resolved the problem that you were seeing?
Please let me know if I can be of assistance....

Kind Regards

Tristan
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 2
(3,107 Views)