本文整理匯總了C#中Windows.UI.Xaml.Controls.Grid.TransformToVisual方法的典型用法代碼示例。如果您正苦於以下問題:C# Grid.TransformToVisual方法的具體用法?C# Grid.TransformToVisual怎麽用?C# Grid.TransformToVisual使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Windows.UI.Xaml.Controls.Grid
的用法示例。
在下文中一共展示了Grid.TransformToVisual方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnApplyTemplate
protected override void OnApplyTemplate()
{
base.OnApplyTemplate();
Loaded += Clr_Pckr_Loaded;
clrViewbox = GetTemplateChild("clrViewbox") as Viewbox;
pointer = GetTemplateChild("pointer") as Grid;
reference = GetTemplateChild("reference") as Border;
rtrnsfrm = GetTemplateChild("rtrnsfrm") as CompositeTransform;
innerCanvas = GetTemplateChild("innerCanvas") as Canvas;
innerEll = GetTemplateChild("innerEll") as Grid;
ColorImg = GetTemplateChild("ColorImg") as Image;
thumbInnerEll = GetTemplateChild("thumbInnerEll") as Thumb;
rectColor = GetTemplateChild("rectColor") as Rectangle;
gdStop = GetTemplateChild("gdStop") as GradientStop;
FinalColor = GetTemplateChild("FinalColor") as Ellipse;
testblock = GetTemplateChild("test") as TextBlock;
ColorImg.Tapped += ColorImg_Tapped_1;
rectColor.PointerPressed += Rectangle_PointerPressed_1;
thumbInnerEll.DragDelta += Thumb_DragDelta_1;
ColorImg.PointerReleased += ColorImg_PointerReleased_1;
ColorImg.PointerPressed += ColorImg_PointerPressed_1;
ColorImg.PointerMoved += ColorImg_PointerMoved_1;
gdStop.Color = SelectedColor;
FinalColor.Fill = new SolidColorBrush(SelectedColor);
GeneralTransform gt = pointer.TransformToVisual(reference);
Point p = new Point();
p = gt.TransformPoint(p);
px = p.X;
py = p.Y;
loadnew();
}
示例2: getPhotoPosition
private PhotoPosition getPhotoPosition(Grid g)
{
var ttv = g.TransformToVisual(Window.Current.Content);
Point screenCoords = ttv.TransformPoint(new Point(0, 0));
if (screenCoords.X - g.ActualWidth < g.ActualWidth * -2)
{
return PhotoPosition.OffscreenLeft;
}
if (screenCoords.X > Window.Current.Bounds.Width)
{
return PhotoPosition.OffscreenRight;
}
if (screenCoords.Y - g.ActualHeight < g.ActualHeight * -2)
{
return PhotoPosition.OffscreenTop;
}
return PhotoPosition.Other;
}