Hi,
I’m write a application in WPF to display handwritten text and images. For this purpose i choosed the InkCanvas-object.
I finally could add an image to the InkCanvas by adding it as a child to the Children-property. I even could select, scale and move it. But there are some main issues I have to solve.
First of all it is only possible to move the image by selecting the highlighted border, but I want to do the same action by clicking on the object and moving it.
Second the image jumps in a unpredictable direction during a scale process and is not always scaled correctly. (Stretch-property is set to “Uniform” and StrechDirections to “Both”)
The preview scaling frame is not correctlly set to “Uniform”.
Does any one have an idea, how i can solve the first to problems?
Greets,
Eckhard
PS.: Here is a link to a demo-application: http://msdn.microsoft.com/en-us/library/aa972135.aspx
Just paste the following code into the methode “OnInsertTextBox”:
BitmapImage b = new BitmapImage();
b.BeginInit();
b.CreateOptions = BitmapCreateOptions.PreservePixelFormat;
// This URI have to be an image on your pc
b.UriSource = new Uri(@"C: emp\csharp\me.jpg");
b.DecodePixelWidth = 200;
b.EndInit();
Image i = new Image();
i.Source = b;
inkCanvas.Children.Add(i);