09-23-2011 10:29 AM
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?
09-23-2011 01:20 PM
I'm not seeing the undo buffer purge that you mentioned. Is there a specific sequence of steps one needs to do?
09-23-2011 03:21 PM
The methods I'm executing are: VI->Transaction.Begin Undo, Ctl->Replace, Ctl->Get Image, VI->Transaction.End Undo.
09-23-2011 03:41 PM
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.
09-28-2011 10:44 AM
Yes, that works in LV 2010, but not in LV 2011. I've managed to cobble together a workaround that works reasonably well.