首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在油墨画布外显示图像

如何在油墨画布外显示图像
EN

Stack Overflow用户
提问于 2011-01-13 08:39:48
回答 1查看 861关注 0票数 0

我有一个名为"drawCanvas“的画布,用于显示画布中包含的图像和墨水画布,称为"CanvasContainInkCanvas”。我可以用MatrixTransform放大。

代码语言:javascript
复制
//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;

如果我放大,我可以看到画布外面的图像。

我想复制图像从画布到墨水画布使用选择。我的问题是这些图像不能在画布外显示。

如何在画布外显示图像?

谢谢

更新:如何在油墨画布外使用选择?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-01-13 08:46:06

ClipToBounds="False"设置在InkCanvas上。默认情况下,它被设置为True

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4678116

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档