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,173 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,150 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,142 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,138 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,101 Views)