StrokeCollection.GetBounds Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Koleksiyondaki vuruşların sınırlarını döndürür.
public:
System::Windows::Rect GetBounds();
public System.Windows.Rect GetBounds ();
member this.GetBounds : unit -> System.Windows.Rect
Public Function GetBounds () As Rect
Döndürülenler
Rect içindeki vuruşların StrokeCollectionsınırlarını içeren bir.
Örnekler
Aşağıdaki örnekte, 'nin StrokeCollection sınırlarını alma ve bunları denetime çizme işlemleri gösterilmektedir. Bu örnekte adlı inkCanvas1
bir InkCanvas olduğu varsayılır.
public void GetBounds()
{
Rect bounds = inkCanvas1.Strokes.GetBounds();
Rectangle boundsShape = new Rectangle();
boundsShape.Width = bounds.Width;
boundsShape.Height = bounds.Height;
boundsShape.Stroke = Brushes.Red;
InkCanvas.SetTop(boundsShape, bounds.Top);
InkCanvas.SetLeft(boundsShape, bounds.Left);
inkCanvas1.Children.Add(boundsShape);
}
Public Sub GetBounds()
Dim bounds As Rect = inkCanvas1.Strokes.GetBounds()
Dim boundsShape As Rectangle = New Rectangle()
boundsShape.Width = bounds.Width
boundsShape.Height = bounds.Height
boundsShape.Stroke = Brushes.Red
InkCanvas.SetTop(boundsShape, bounds.Top)
InkCanvas.SetLeft(boundsShape, bounds.Left)
inkCanvas1.Children.Add(boundsShape)
End Sub
Açıklamalar
yöntemi, GetBounds işlenen Strokegörünümünü alan bir Rect döndürür. Örneğin, 10 monitör bağımsız piksel (DIP) genişliğindeyse Stroke , Rect genişliğin Stroketamamını içerir.