2011-01-13 6 views
0

"CanvasContainInkCanvas"라는 캔버스에 포함 된 이미지와 inkcanvas를 표시하는 "drawCanvas"캔버스가 있습니다. MatrixTransform을 사용하여 축소 할 수 있습니다.inkcanvas 외부에 이미지를 표시하는 방법

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

축소하면 캔버스 외부의 이미지를 볼 수 있습니다. alt text

이미지를 캔버스에서 inkcanvas로 복사하여 선택 항목을 사용하고 싶습니다. 내 문제는 이미지를 inkcanvas 외부에 표시 할 수 없다는 것입니다.

alt text

어떻게 inkcanvas 외부 이미지를 표시합니까?

감사

업데이트

:은 어떻게 inkcanvas 이외의 선택을 사용합니까?

답변

2

InkCanvasClipToBounds="False"을 설정하십시오. 기본값은 True입니다.

+0

좋아, 이제 이미지를 표시 할 수 있지만 새로운 문제가 있습니다. inkcanvas 외부에서 선택 영역을 사용하려면 어떻게해야합니까? –

+0

'InkCanvas 외부 선택'이란 무엇입니까? – decyclone

관련 문제