Question

J'ai appelé « toile drawCanvas » pour afficher des images et InkCanvas qui est contenu dans la toile appelée « CanvasContainInkCanvas ». Je peux effectuer un zoom arrière en utilisant 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;

Si je effectuer un zoom arrière, je peux voir des images toile extérieure. text alt

Je veux copier des images de la toile à InkCanvas à la sélection d'utilisation. Mon problème est que les images ne peuvent être montrées en dehors InkCanvas.

text alt

Comment puis-je afficher des images en dehors InkCanvas?

Merci

Mise à jour: Comment puis-je utiliser la sélection InkCanvas de l'extérieur

Était-ce utile?

La solution

Set ClipToBounds="False" sur ce InkCanvas. Par défaut, il est réglé sur True.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top