StylusPlugIn.ElementBounds Özellik
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.
öğesinin önbelleğe alınmış sınırlarını alır.
public:
property System::Windows::Rect ElementBounds { System::Windows::Rect get(); };
public System.Windows.Rect ElementBounds { get; }
member this.ElementBounds : System.Windows.Rect
Public ReadOnly Property ElementBounds As Rect
Özellik Değeri
öğesinin önbelleğe alınmış sınırları.
Örnekler
Aşağıdaki örnekte, 'den devralan bir DynamicRendereröğesinin StylusPlugInvuruşu işlemek için nasıl kullandığı ImageBrush gösterilmektedir. Bu fırça, tarafından imageFile
belirtilen görüntü dosyasını kısmen çizer.
if (imageBrush == null)
{
// Create an ImageBrush. imageFile is a string that's a path to an image file.
image1 = new BitmapImage(new Uri(imageFile));
imageBrush = new ImageBrush(image1);
// Don't tile, don't stretch; align to top/left.
imageBrush.TileMode = TileMode.None;
imageBrush.Stretch = Stretch.None;
imageBrush.AlignmentX = AlignmentX.Left;
imageBrush.AlignmentY = AlignmentY.Top;
// Map the brush to the entire bounds of the element.
imageBrush.ViewportUnits = BrushMappingMode.Absolute;
imageBrush.Viewport = this.ElementBounds;
imageBrush.Freeze();
}
If imageBrush Is Nothing Then
' Create an ImageBrush. imageFile is a string that's a path to an image file.
image1 = New BitmapImage(New Uri(imageFile))
imageBrush = New ImageBrush(image1)
' Don't tile, don't stretch; align to top/left.
imageBrush.TileMode = TileMode.None
imageBrush.Stretch = Stretch.None
imageBrush.AlignmentX = AlignmentX.Left
imageBrush.AlignmentY = AlignmentY.Top
' Map the brush to the entire bounds of the element.
imageBrush.ViewportUnits = BrushMappingMode.Absolute
imageBrush.Viewport = ElementBounds
imageBrush.Freeze()
End If
Açıklamalar
, StylusPlugIn isabet testi gerçekleştirmek için öğesinin sınırlarını önbelleğe alır.
Şunlara uygulanır
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin