Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Limit to # of colormap values (CWgraph3D)

I am trying to increase the quality of my plot by adding more colors to it. I created a test form (attached) that shows what I am talking about. For the test form I plot 512x512 data and apply a 64, 128, 256, and 512 colormap values to the respective plots. I do this to show that they all look exactly the same! Shouldn't the 128 look twice as nice (half as many color divisions) and so on?

Or is there a limit to the # of colormap values that can be applied to a plot?
0 Kudos
Message 1 of 6
(6,956 Views)
The size of the color map array is limited to 256 colors. This limitation is imposed by the OpenGL library that we use to implement the 3D graph. This limitation is missing from the documentation (we added it in the C++ documentation in version 7.1, but that doesn't really help you).

When I run your example program, I see a difference between 64, 128, and 256. There is no difference between 256 and 512. How are you verifying that the plots are the same? I used ZoomIn.exe, which ships with Visual C++ 6.0.
0 Kudos
Message 2 of 6
(6,955 Views)
You can see a difference? If you zoom in on the graphs (using the cwgraph3d's zoom ability) I see distinct even bands of colors that compare directly to each other graph. Maybe you could explain this further?

After further investigation, it seems to me that the limitation is at 64 values because I tried the same plot using 32 colors and then I could see a difference (bands were twice as wide).

What is this ZoomIn.exe? I need these graphs to run in my vb6 application so I don't see how a c++ program will aid me.
0 Kudos
Message 3 of 6
(6,955 Views)
I do see a difference between the 64 colors graph and the 128 colors graph in the application that you posted.

ZoomIn.exe is a utility that you can use to zoom in on a part of your screen. I used this utility to zoom in close enough to clearly see the color bands in the graphs in your application. I was not suggesting that this program would help you use the graphs.

I have attached a screenshot that shows what I see in the zoomin utility when I zoom in on the application that you wrote. On the left is the 64 colors graph and on the right is the 128 colors graph. I pasted the image into Paint and drew black lines at the color boundaries. The color change is very subtle, but the screenshot shows that there are two different color bands in the 128 case within a single color band in the 64 case. I saw this also when I zoomed the graphs in your application by changing the ranges of the X, Y, and Z axes from 0-512 to 1-100.

When you zoom in on the 3D graph and don't see a difference in the number of color bands between the 64 colors graph and the 128 colors graph, how are you ensuring that you are zooming by the same amount? Are you programmatically changing the axis ranges? If you zoom just with the mouse, I'm not sure how exactly you would ensure that you are zooming each graph by the same amount.

If you rotate the graph in addition to zooming it, you can see the color band boundaries a little bit more clearly. I have attached a screenshot of what I see when I zoom the two graphs in by changing the axis ranges to 1-250. I rotated the plots as well, so that you can see where the color band boundaries are. You should see that the 128 colors graph has twice as many bands as the 64 colors graph.

To view the screenshots, I suggest that you right left click, choose Save Target As, and use paint or another image viewer to look at the image rather than using your web browser to view it directly. Let me know if these screenshots clear things up and if you are able to see the same thing on your system. One explanation for you and me seeing different behavior could be our display color settings.
Download All
0 Kudos
Message 4 of 6
(6,955 Views)
OK so I figured a few things out. My monitor was set to 16bit color. When I changed this to 32bit color I could clearly see the difference. Why is this a problem? Are Measurement Studio controls made to work correctly with 32bit color?
0 Kudos
Message 5 of 6
(6,955 Views)
When I change my display setting to 16-bit color, I also see the behavior that you describe. I am not an expert in this area, but I believe that it makes sense given the set of colors that you are using. With 16-bit color, 5 bits are for Red, 6 bits are for Green, and 5 bits are for Blue. Five bits yield 32 values and 6 bits yield 64 values. So, even though for the 128 color case you generate 64 shades of red, only 32 different shades actually render. I experimented with your program and saw that if I make the color map colors include red, green, and blue values instead of just red and green, I can see a difference in the number of bands between 64 values and 128 values, even when my display is 16-bit color.
0 Kudos
Message 6 of 6
(6,956 Views)