Hi,
I am trying to convert an older Window Forms application to WPF, and I am stuck on this one function. It takes the image in a PictureBox control, grabs a specific section of it, and moves that section of the image to another control.
Anyway, here is the old code. Can anyone please convert this to work in WPF for me? I have many functions like this, but once I get the foundation of what I need to do, I'll be able to finish the rest of the functions.
int sx = (selectedPaletteTile % paletteColumns) * 33; int sy = (selectedPaletteTile / paletteColumns) * 33; Rectangle src = new Rectangle(sx, sy, 32, 32); Rectangle dst = new Rectangle(0, 0, 32, 32); Graphics gfxSelected; gfxSelected.DrawImage(pictureBoxPalette.Image, dst, src, GraphicsUnit.Pixel); pictureBoxSelected.Image = selectedBitmap;
My problem is that the new System.Windows.Shapes.Rectangle class no longer has a constructor for setting the location/size, and I cannot find the Graphics class either. So I'm really stuck on converting this.
Thanks.