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.
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.
Yes, that works in LV 2010, but not in LV 2011. I've managed to cobble together a workaround that works reasonably well.