my program is supposed to load a picture from a third party application, display it as it is in a PictureBox. Then modify the image through some image processing algorithm and display the resulting image in the same PictureBox. Then fetch another image from the external system, display it, process it, display the result and so on and so forth. All this should result in the user seeing the images one after with a few seconds delay between them.
Is it possible to do this in Windows Forms (the project is coded in C++/CRL)? If so, how can I do it?
the code I have done so far looks like this (Im only displaying the chunks of code that I believe are relevant to understand what I want to achieve):
private: Bitmap^ image1; private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { //connecting to the third party application PImage PI; PI.EstablishConnection(); //setting image parameters PI.setImageParameters(x, y, z, yaw, pitch, roll); //retrieving image data int W = PI.returnCols(); int H = PI.returnRows(); //updating Bitmap object as per image data image1 = gcnew Bitmap (W, H); //.... //function to modify the display and load the new image in pictureBox ModifyDisplay (image1->Height, image1->Width, image1, PI); pictureBox1->Image = image1; //... //process current image using some algorithms //modify current image as per the processing and display it ModifyDisplay (image1->Height, image1->Width, image1, PI); pictureBox1->Image = image1; //...fetch a new image //function to modify the display and load the second image in pictureBox ModifyDisplay (image1->Height, image1->Width, image1, PI); pictureBox1->Image = image1; //... //process second image using some algorithms //...and so on }
The result I get is that only the last image is displayed, all that goes on before does not show.