LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a custom control or dial rotate properly

I am trying to make a custom dial by replacing the needle with a picture of a human leg. However, when I try importing the picture into the Customize mode the leg rotates, but it is always pointing up-down. I want to make it so the toes of the leg move to each tick mark and knee is at the pivot point. How can I change this? Thanks!
0 Kudos
Message 1 of 11
(7,229 Views)
Hi Johnny-o,

A customized control will NOT rotate the graphics imbedded as you have tried.

I will watch this Q in the hopes that I am wrong.

Possible work-arounds;
1) Use a Picture Ring and import you previously rotated graphics into a seperate image for each possible display value. Comment: If you need to display more than a handful of values, this technique will become very tedious and is subject to human error.

2) Use a picture control (with an invisable frame) that over-lays a background guage. You can then use the "Rotate Image.VI" (see link below) to rotate your image.

http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3DD2156A4E034080020E74861&p_node=DZ52035&p_submitted=N&p_rank=&p_answer=&p_source=External

The big dra
w back in this second approach is performance. Rotating a large image is CPU intensive. If this becomes an issue, you could "pre-proccess" all of your possible images and cache them so that you only have to update the picture control and not have do all of the tedious math repeatedly.

So...

I would still like to find an easier method.

I hope this helps,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 11
(7,230 Views)

As NI address this issue? I would also like to customize the guage to have a different needle.

0 Kudos
Message 3 of 11
(6,500 Views)

Hi jonny-o,

Ben is right. You can not add diiferent images for different needle positions. Best way is to use picture ring. You can hide needle of the gauge.

We had used same method. We wanted to show handle image in place of needle Smiley Wink...It is very easy.Smiley Happy

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 4 of 11
(6,492 Views)

Hi j3r3mi,

I don't think NI will address this, as this is not a issue. It will be tedious for programmer as well to add images to each and every position.

It depends on range as well, what if your gauge range is from 0 to 1000, are you going to put 1000 images?

 

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 5 of 11
(6,489 Views)

I think its trival, they don't really need to create picture rings. Like what was mention previously, this just need to rotate the image of the needle. The just need to do some backend coding for this feature to rotate the image (as what they did for the orignal needle).

 

And its an issuse and a bug, because the IDE allowed us to customize the needle (resizing, load an image). But when i move it, the image is static. 

0 Kudos
Message 6 of 11
(6,485 Views)

 


@j3r3mi wrote:

I think its trival, [...]


 

Sadly, it is not trivial. There are several threads on "rotate image", one being this. If you look into the example provided from altenbach (RotateVase.vi), you will see an example of the code necessary/usable for rotating images.You are correct, that by itself, the algorithm of rotating is 'simple arrayhandling'. But that can lead to sever distortion of the image in certain angular configurations. And do not forget: What about resizing?

 

One thing you can do, as an individual programmer: Create your own XControl which uses altenbachs example as guideline on how to rotate you custom needle.

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 7 of 11
(6,472 Views)

I agree with u. However, if i uderstand correctly, LV is written in C. I wonder if the built-in controls are written in C or LV? If its the latter, it would be like what u said; not tribval. If its written in C, probably libraries like GDI would be used.

 

Sorry, i'm just speaking from my perspective. I think it would be more appropriate for NI engineers to comment.

 

😄

0 Kudos
Message 8 of 11
(6,469 Views)

What LV does now it does rather well.

 

Over the years I have only heard a cry for this feature a handful of times so it appears the demand for this feature is quite limited.

 

NI put their resource where it will do the most good. If the was an out cry for this feature (That I want by the way) Ni would concider it.

 

I had a detailed discusion with R&D over this issue. I do not remembe the detaitls so I don't think I will reveal any secrets but here goes...

 

Most graphics in LV are represented using a method that deals with them as a rectangle with a top left and bottom right corner. the Needles etc are special little critters that use anoth represntation that goes back to features originally exposed for old MACs. AS long as the image used to rreplace the needle is of the proper type LV can rotate it. Example is the "Arrow" decorations. THese are in the propber form and can be used to replace the needle.

 

I explored what it would take to expose the ability to create those special widget myself end with R&D walking away shaking thier heads and I got the impression I should not hold my breath.

 

So that is waht I know about the "why" behind why we are limited in rotating images.

 

But as mentioned above there are multiple work-arounds available so use one of those and if you really want the rotating image stuff, submit a suggestion.

 

Your brother in wire,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 11
(6,444 Views)

Having had to focus more on the front end gui side of things recently, i find custom GUI controls and other development options for labview front panels horrendous.  Maybe it’s just a lack of experience, but between not being able to handle custom vectors graphics, as well as this annoying .png image scaling issue i keep running into, I'm finding it painful to develop flashier GUI's for clients.  I for one would like to see NI really push for updating their front panel components to better align with the type of gui's we see today.  I know you can do a lot with the current design, but as this thread mentions, the work a rounds and back end coding involved compared to other languages really can be time consuming.  

0 Kudos
Message 10 of 11
(6,198 Views)