Shijin Knox Posted November 12, 2009 Report Share Posted November 12, 2009 Can any one please tell me how can we create a scale programatically. My requirement is there is an Xcontrol for image display. There should be horizontal and vertical scales on both sides of this control. There is a ring structure for selecting "mm" or "inch" units of the scales. When I select "mm" the scale displayed in the xcontrol should be "mm" scale if I select "inch" inch scale should be displayed. Please help. Quote Link to comment
dblk22vball Posted November 12, 2009 Report Share Posted November 12, 2009 What are you using to display the data in your Xcontrol, a graph? If so, there are property nodes that you can change the scale to whatever you want it to appear as. You will probably have to do the conversion of mm to in yourself to display it correctly, but you can use the property node to edit the scale. Quote Link to comment
Black Pearl Posted November 12, 2009 Report Share Posted November 12, 2009 You should be able to use the built-in units of the controls. The user can change them by tyoing in mm, in, ft... Select visible->Unit Lable and type in mm. You will need to convert your data by cast to unit. Felix Quote Link to comment
Shijin Knox Posted November 16, 2009 Author Report Share Posted November 16, 2009 Hi, My Xcontrol should look like the attached image. Here the scales should change automatically when we selece mm or inch from a combo box. This control is used to display jpeg images. Thanks Quote Link to comment
Ton Plomp Posted November 16, 2009 Report Share Posted November 16, 2009 Sure. Go to your local hardware store and select a big value pack of batteries. Take them off the shelf. Put them in your cart. Buy it and bag it. Take it home. Take it to your room. You are in control of it's movement. Dance with it if you want. A car battery will give you a bigger charge but it's a lot harder to dance with. The Image VIs have some VIs to create scales, determing the size of the JPEG and the end-value of the scale. Writing all these info to a picture display should get you started. I advise you to first do this with normal VIs and deal later with the XControl building, so first the a proof of concept and place the VIs you create into your XControl. Ton Quote Link to comment
Shijin Knox Posted November 16, 2009 Author Report Share Posted November 16, 2009 Dear Tom, That was very kind of you. Could you please mention the names of VIs to create scales, determing the size of the JPEG and the end-value of the scale. That will be so greatful for me. Quote Link to comment
Ton Plomp Posted November 16, 2009 Report Share Posted November 16, 2009 If you search the palettes for JPEG, you wil get a JPEG loader. This returns a cluster where one of the elementsis a rectangle containing the size of the image. The scale VIs are on the Picture Plot VIs palette Ton Quote Link to comment
Shijin Knox Posted November 17, 2009 Author Report Share Posted November 17, 2009 Dear Ton, I've already come across that example. But all that VIs are applicable with picture control right? But I have to use image.ctl That is the problem here. Its look and feel also should be like the image attached earlier Quote Link to comment
Ton Plomp Posted November 17, 2009 Report Share Posted November 17, 2009 I don't know what image.ctl is. But with the VIs in the picture palette you can easily create the image you've shown. What code do you have allready? Ton Quote Link to comment
Rolf Kalbermatter Posted November 18, 2009 Report Share Posted November 18, 2009 I don't know what image.ctl is. But with the VIs in the picture palette you can easily create the image you've shown. What code do you have allready? Ton image.ctl is the IMAQ Vision Image Control. And that does not have a scale at all, since that is not how images are typically used. Calibrating an image to be exact in physical measurements is a very difficult task in itself. Especially since such a scale has only any meaning for a very specific depth plane in the picture. Anything a little further away or closer by has a different scale. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.