I have create a PictureBox with an image. I want to change the image during run time. I have found an instruction GetImage(“xxx.bmp”). My question is “Where do i have to put my xxx.bmp on my pc, on the virtual controller and on the real controller?” If i run the application on the virtual controller i get this fault “System.NullReferenceException”.
I recommend to put the image in the HOME directory or a sub-directory in HOME. Then use the FileSystem.RemoteDirectory and copy ( FileSystem.GetFile(remoteFile, localFile) ) to the local directory using FileSystem.LocalDirectory property.
3 remarks here.
Use “/” to separate directories.
Create subdirectories explicitly for local storage.
Default values: VIRC5 RemoteDirectory is “system”/HOME, VIRC5 LocalDirectory is “system”/INTERNAL, Controller RemoteDirectory is HOME and LocalDirectory is /Temp. (For debugging purpose good to know)
To get better performace on controller, do not use PictureBox. Instead do your own Paint overriding OnPaintBackground, etc.
I had problems with PictureBox because of my inability to predict where and when to repaint after painting added information in the image. So I placed the calls a bit everywhere. This and added complexity of handling controller events (5.05) made performance a problem for me. Sorry, but I can’t prove that PictureBox was the major problem (my collegue says SBK!).
What I do know is that when I do not use PictureBox I can predict and test when the paint events are done and that I don’t draw the images, added information and texts when it is not necessary.
I should have remarked in the post above that if the functionality is good enough, PictureBox is OK. On the RC a certain lag is to be expected.