It’s simple enough to define an image in xaml and move it around, but how would I do this programmaticly? I define my Image like this:
System.Windows.Controls.Image imgpanel = new System.Windows.Controls.Image();
imgpanel.Source = loadBitmap(capwin);
And I’d like to be able to set it on my window. How would I got about this?
Since you’re using a grid, if your desired location for the image is (x,y), use this code:
Adjusting the margin of the image relative to the grid will cause the image to move around on the grid.
This also works if the image is added directly to the window.