Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Example C# code for CanShowFocus property

I need to draw a focus rectangle inside of the plot area of an Intensity graph. Can I uses the CanShowFocus property, is there a C# example?

0 Kudos
Message 1 of 10
(7,119 Views)

bill_donahue,

 

The CanShowFocus property just shows a box around the whole Intensity Graph. That is, when you click on the graph when the program is running, a dotted line shows up around the whole graph to indicate that it is the object that is currently selected.

When you say that you need a focus rectangle inside the plot area, what do you mean? Do you just want to draw a rectangle on part of the graph?

You might be looking for something like an intensity range annotation, which you can add by right-clicking in the graph area and selecting Edit Annotations. You can also add annotations programmatically. This is an old example, but the C# should be the same:

http://zone.ni.com/devzone/cda/epd/p/id/5046

 

Kelsey Johnson

Applications Engineer

National Instruments

0 Kudos
Message 2 of 10
(7,098 Views)

Kelsey,

   I don't really need annotations, what I need is a way to select a region of plots on a graph with a rectangle select tool,

similar to the zoom tool. I would like to draw a rectangle around an area, like the Shift + Left Mouse Click drag,

an have the rectangle remain on the screen until the operator either makes a new rectangle or right clicks the mouse.

I have some software written now that draws a rectangle and then uses

intensityPlot1.InverseMapDataPoint(intensityGraph1.PlotAreaBounds, p, out xValue, out yValue); to get the plots.

The problem is that the rectangle does not stay displayed on the graph.

Thanks,

Bill

0 Kudos
Message 3 of 10
(7,093 Views)

Kelsey,

    I have a C# example that I can email you that describes the issue that I am having with drawing a rectangle over the Intensity Graph plot area.

How do I upload my solution file?

Thanks,

Bill

0 Kudos
Message 4 of 10
(7,075 Views)

Hey Bill,

 

You can add attachments when you reply to a forum post.

I can find plenty of examples for how to do something similar to what you’re describing in LabVIEW, but I’ve never tried to do it in Visual Studio. I’d be happy to take a look and see what I can figure out.

 

Kelsey

0 Kudos
Message 5 of 10
(7,068 Views)

I have a panel on top and an intensity graph on the bottom of my form. If you right click on the panel or the graph, and drag and drop, a red rectangle is drawn.

The intensity graph event code calls the same exact code as the panel event code. If you draw a rectangle on the intensity graph and then left click on the graph it

messes up the next time you right click and draw a rectangle on the graph.

 

I need the graph code to function the same as the panel when one or more rectangles are drawn. I have been working on this issue for several weeks now.

Thanks,

Bill

0 Kudos
Message 6 of 10
(7,066 Views)

Hi,

   Its been two weeks since I posted my C# project file. Can you help me with my questions, or reroute this request to someone that can?

Thanks I would really appreciate it.

Bill.

0 Kudos
Message 7 of 10
(6,979 Views)

Hi,

   Its been about 3 months since my last  post and I still need to resolve this issue. I need to be able to put 1 to n number of region boxes (rubber-band) over the plots of an Intensity Graph. I believe my company pays NI for support but I am not sure the best way to get it, is it in this forum? I really need to resolve this issue soon.

Thanks

Bill D.

0 Kudos
Message 8 of 10
(6,814 Views)

bil_donahue,

 

I spoke with Edna, who is currently assisting you with this issue, and she, along with other engineers, will be happy to help from the NI Support side.

Jason H
Automated Test Software R&D
0 Kudos
Message 9 of 10
(6,792 Views)

See attached example of using an Annotation box to mimic a region box.

Bill D.

0 Kudos
Message 10 of 10
(6,754 Views)