0

I'm trying to code a image viewer with C# WPF. I'm using System.Windows.Controls.Image to view an image. I can read the image from file with rectangle. (I've my own ReadScaledRegion function to read the specific rectangle of image from file)

My problem is, I want to move the picture inside the image control and reload the empty parts of image control.

When I do it with Windows Forms, PictureBox's Paint event gives me the ClipRectangle to reload the empty parts. But I can't do it with WPF.

Is there any way to do that with WPF?

Thank you!

cKNet
  • 635
  • 1
  • 10
  • 22
  • `Canvas` have overridable `OnRender` method – pushpraj Aug 27 '14 at 12:26
  • I know Canvas have OnRender method. But this OnRender function don't have the empty space rectangle like ClipRectangle from WinForms' PictureBox's overridable Paint method – cKNet Aug 27 '14 at 12:42
  • indeed correct, but I am sure there are ways to achieve the same. is it possible for you to share a working sample? may I try to help you with the desired. in the mean while you can look at this answer, it shows various method of drawing, painting an image can also be achieved in similar manner. http://stackoverflow.com/questions/25450979/terrible-performance-of-custom-drawn-control/25488069#25488069 – pushpraj Aug 27 '14 at 12:45

0 Answers0