質問
「drawcanvas」と呼ばれるキャンバスがあり、「canvascontaininkcanvas」と呼ばれるキャンバスに含まれる画像とインクカンバスを表示します。 MatrixTransformを使用してズームアウトできます。
//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;
ズームアウトすると、キャンバスの外に画像が表示されます。
CanvasからInkcanvasに画像をコピーして、選択を使用したいと思います。私の問題は、Inkcanvasの外に画像を表示できないことです。
Inkcanvas以外の画像を表示するにはどうすればよいですか?
ありがとう
アップデート: Inkcanvas以外で選択を使用するにはどうすればよいですか?
解決
セットする ClipToBounds="False"
その上 InkCanvas
. 。デフォルトでは、に設定されています True
.
所属していません StackOverflow