C# 如何在inkcanvas外部显示图像

C# 如何在inkcanvas外部显示图像,c#,wpf,inkcanvas,C#,Wpf,Inkcanvas,我有一个名为“drawCanvas”的画布来显示图像和inkcanvas,它包含在名为“CanvasContaineInkCanvas”的画布中。我可以用矩阵变换缩小 //Get the image that's being manipulation. Canvas element = (Canvas)e.Source; //Ues the matrix of the transform to manipulation the element's appearance. Matrix matr

我有一个名为“drawCanvas”的画布来显示图像和inkcanvas,它包含在名为“CanvasContaineInkCanvas”的画布中。我可以用矩阵变换缩小

//Get the image that's being manipulation.
Canvas element = (Canvas)e.Source;
 //Ues the matrix of the transform to manipulation the element's appearance.
Matrix matrix = ((MatrixTransform)drawCanvas.RenderTransform).Matrix;
//Get the ManipulationDelta object.
ManipulationDelta deltaManipulation = e.DeltaManipulation;
//Find the old center, and apply any previous manipulations.
Point center = new Point(element.ActualWidth / 2, element.ActualHeight / 2);
//Apply new move manipulation (if it exists).
center = matrix.Transform(center);
 //Apply new zoom manipulation (if it exists).
matrix.ScaleAt(deltaManipulation.Scale.X, deltaManipulation.Scale.Y, center.X, center.Y);
//Translation (pan) 
matrix.Translate(e.DeltaManipulation.Translation.X, e.DeltaManipulation.Translation.Y);
//Set the final matrix.
((MatrixTransform)drawCanvas.RenderTransform).Matrix = matrix;
// set the matrix of canvas that contain inkcanvas
((MatrixTransform)CanvasContainInkCanvas.RenderTransform).Matrix = matrix;
如果缩小,我可以看到画布外的图像。

我想将图像从画布复制到inkcanvas以使用选择。 我的问题是图像不能在inkcanvas之外显示

如何在inkcanvas之外显示图像

谢谢


更新:如何在inkcanvas外部使用选择?

在该
inkcanvas上设置
cliptobunds=“False”
。默认情况下,它设置为
True

好的,我现在可以显示图像,但我有新问题。如何使用inkcanvas外部的选择?您所说的inkcanvas外部的选择是什么意思?