Frage

Ich habe Leinwand „drawCanvas“ genannt Bilder und InkCanvas zu zeigen, die in der Leinwand namens „CanvasContainInkCanvas“ enthalten ist. Ich kann mit Matrixtrans verkleinern.

//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;

Wenn ich verkleinern, kann ich Bilder außerhalb Leinwand sehen. alt text

Ich mag Bilder von der Leinwand zu InkCanvas zu verwenden Auswahl kopieren. Mein Problem ist, dass die Bilder nicht außerhalb InkCanvas gezeigt werden.

alt text

Wie kann ich außerhalb InkCanvas Bilder?

Danke

Update: Wie verwende ich Auswahl außerhalb InkCanvas

War es hilfreich?

Lösung

Set ClipToBounds="False" auf diesem InkCanvas. Standardmäßig ist es auf True gesetzt.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top