04-24-2014 06:20 AM
I'm trying to move a picture from one cell of a table to another using the clipboard but I'm not able to: while no error is found in copying the original image with ClipboardPutTableVals, ClipboardGetTableVals always states no picture is available in the clipboard (which is true since I cannot paste anything to Paint for example).
I'm working on a single cell: the help states that in this case the picture should be copied to the clipboard.
I am attaching a simple project that exhibits the problem: simply click anywhere in a row that has a picture and press Move, input the row where you want the picture to be copied and see the result.
Tested in CVI 2012SP1 and 2013SP1 on a Win7Pro SP1 box.
Solved! Go to Solution.
04-24-2014 07:30 AM
Hi Roberto,
It seems that GetTableCellVal and SetTableCellVal can do what you need...
Beyond that, I don't understand at all why your example does not work. As far as I understand ClipboardPutTableVals and ClipboardGetTableVals function help, your method should work...
04-29-2014 11:10 AM
I've confirmed that this is a bug (468617), introduced in version 2012. Normally, picture cells are processed as text cells in the ClipboardPutTableVals function, but they are also supposed to be processed as picture cells if the specified range consists of a single picture cell. However, that is not happening. It's only working for interactive copying (Ctrl+C).
Sorry about this. Let me know if you need any additional workaround ideas beyond what Julien suggested.
04-30-2014 02:51 AM
Hello Julien,
thaks for your idea. Your solution works as expected, but I need to explicitly discard the bitmap after at routine end: if this is a routinary task and I somewhere forget to discard the bitmap I can have a growing up memory leak, which I would not expect using the clipboard. Besides it, the clipboard should make the picture available to other programs too. In any case, since according to Luis answer it is the only feasible solution at the moment I will use your suggestion.
04-30-2014 02:58 AM
Hello Luis, thanks for looking into this.
Indeed Julien solution works and I will use that one in my application. Nevertheless, I would like to have some clarification regarding your answer.
You said this bug was introduced in CVI2012, but I have made my tests on CVI2009 and I can't get it to work; I can only think that it depends on the run-time: on my system I have CVI2013 installed so that is the runtime I am working on and this could explain the problem. Unfortunately I don't have a system with RTE 2009 installed to test it on so I can't double check this fact.
Also, it appears it is not fixed in CVI2013: am I correct or there's something wrong in my code?
04-30-2014 11:34 AM
Yes, this bug is in the run-time engine, and no, it hasn't been fixed yet and there's nothing wrong with your code.
I guess I should have been clearer -- I didn't mean to imply that this is was a known issue. It wasn't. I only found out about it yesterday, as a result of your post.