From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Image of Control

Ordinarily, the "Get Image" method of a control works fine.  However it has the side effect of purging the undo buffer.  I want to get an image of a control without purging the undo buffer.

The "Front Panel:Get Image" method of a VI doesn't purge the undo buffer, so it should be possible to calculate the position of a control on the FP then crop the image.

However there is some extra offset that comes into play that I can't figure out; this offset seems never to vary in any VI, but is different from VI to VI.  The attached VI shows how I'm calculating the position.

Any ideas?

0 Kudos
Message 1 of 5
(2,199 Views)

I'm not seeing the undo buffer purge that you mentioned. Is there a specific sequence of steps one needs to do?

0 Kudos
Message 2 of 5
(2,176 Views)

The methods I'm executing are: VI->Transaction.Begin Undo, Ctl->Replace, Ctl->Get Image, VI->Transaction.End Undo.

 

0 Kudos
Message 3 of 5
(2,168 Views)

In LV10 I have no problem with that sequence (I can undo the operation).  Even when I tried to use the Ctrl reference after the Replace method for Get Image it threw an error but did not cause any problems with undo.

 

ReplaceControlGetImage.png

 

 

0 Kudos
Message 4 of 5
(2,164 Views)

Yes, that works in LV 2010, but not in LV 2011.  I've managed to cobble together a workaround that works reasonably well.

0 Kudos
Message 5 of 5
(2,127 Views)