Cómo mostrar la imagen fuera InkCanvas
Pregunta
Me han llamado lona "drawCanvas" para mostrar imágenes y InkCanvas que se contiene en el lienzo llamado "CanvasContainInkCanvas". Puedo alejar la imagen mediante el uso de 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 Alejar, puedo ver las imágenes tela exterior.
Quiero copiar imágenes de la lona para la selección InkCanvas a su uso. Mi problema es que las imágenes no se pueden mostrar InkCanvas fuera.
¿Cómo puedo mostrar imágenes InkCanvas exterior?
Gracias
Actualización:? ¿Cómo uso InkCanvas fuera de selección
Solución
Conjunto ClipToBounds="False"
en ese InkCanvas
. Por defecto se configura en True
.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow