Visual.VisualScrollableAreaClip 屬性

定義

取得或設定 Visual 的可捲動裁剪區域。Gets or sets a clipped scrollable area for the Visual.

public:  property Nullable<System::Windows::Rect> VisualScrollableAreaClip {  protected public:
Nullable<System::Windows::Rect> get(); protected:
 void set(Nullable<System::Windows::Rect> value); };
public System.Windows.Rect? VisualScrollableAreaClip { protected internal get; protected set; }
member this.VisualScrollableAreaClip : Nullable<System.Windows.Rect> with get, set
Public Property VisualScrollableAreaClip As Nullable(Of Rect)

屬性值

Nullable<Rect>

表示可捲動裁剪區域的 Rect,如果沒有指派裁剪區域,則為 nullA Rect that represents the scrollable clipping area, or null if no clipping area is assigned.

備註

設定 VisualScrollableAreaClip 屬性,以在軟體中轉譯時啟用加速滾動。Set the VisualScrollableAreaClip property to enable accelerated scrolling when rendering in software. 這在遠端呈現案例中很有用,例如透過遠端桌面執行或在虛擬機器中執行。This is useful in remote rendering scenarios, such as running over Remote Desktop or running in a virtual machine. 在子系將會滾動的父元素上設定這個屬性。Set this property on the parent element whose children will be scrolled. 當轉譯 VisualScrollableAreaClip 是硬體加速時,設定屬性不會有任何作用。Setting the VisualScrollableAreaClip property has no effect when rendering is hardware accelerated.

VisualScrollableAreaClip屬性可啟用特定的先進案例。The VisualScrollableAreaClip property enables specific, advanced scenarios. 下列清單顯示當您使用屬性時所適用的警告 VisualScrollableAreaClipThe following list shows the caveats that apply when you use the VisualScrollableAreaClip property.

  • 捲動區域的背景必須是不透明的,否則將會發生滾動成品。The background of the scrolled area must be opaque, or scrolling artifacts will occur.

  • VisualScrollableAreaClip只有當 WPF 在軟體中呈現時,屬性才會加速滾動。The VisualScrollableAreaClip property accelerates scrolling only when WPF is rendering in software. 例如,當應用程式是透過遠端桌面執行,或在虛擬機器的本機環境中執行時,就會發生這種情況。For example, this situation occurs when the application is running over Remote Desktop or running locally in a virtual machine.

  • 在硬體中呈現時,滾動行為不會變更。The scrolling behavior is unchanged when rendering in hardware. 若要避免發生滾動行為的差異,您應該讓 VisualScrollableAreaClip 硬體和軟體都啟用屬性。To prevent differences in scrolling behavior, you should keep the VisualScrollableAreaClip property enabled for both hardware and software.

  • 旋轉和扭曲轉換會停用加速滾動。Rotate and skew transforms disable accelerated scrolling. 在捲動區域上方調整轉換和水準或垂直翻譯,可正常運作,而且不會停用滾動加速。Scale transforms and horizontal or vertical translations above the scrolled region work correctly and do not disable scrolling acceleration.

  • 變更子樹或觸發部分的可捲動區域以透過動畫重新繪製,會如預期般運作,但會失去重新繪製區域的加速滾動的優點。Changing the subtree or triggering parts of the scrollable area to redraw via animation behave as expected, but lose the benefit of accelerated scrolling for the redrawn area. 在執行滾動的相同畫面格中,讓捲動區域失效的任何動畫,都不會有這項優化的好處。Any animation that invalidates the scrolled area during the same frame in which scrolling occurs eliminates the benefit of this optimization.

  • VisualScrollableAreaClip矩形會沿著圖元向內對齊。The VisualScrollableAreaClip rectangle snaps inward to pixels. 因此,已對齊的捲軸矩形大小一律小於或等於您所設定的大小。Therefore, the snapped size of the scrolling rectangle is always less than or equal to the size you have set.

  • 位移靠下對齊。Offsets snap downward. 這表示上一個已捕捉的位移和目前的已對齊位移,其差異一律為整數的圖元數。This means that the difference of the previous snapped offset and current snapped offset is always an integer number of pixels.

  • 點擊測試最多可以關閉圖元。Hit tests can be off by up to a pixel.

  • 版面配置進位應該會開啟,因為它可確保捲動區域和界限視窗工作區的邊緣會貼齊至圖元邊界,以正確對齊。Layout rounding should be turned on, because it ensures that the edges of scrollable areas and the boundary window client area are snapped to pixel boundaries, resulting in correct alignment.

  • 滾動加速不適用於分層視窗。Scrolling acceleration does not work on layered windows. 這表示 windows 中的 AllowTransparency = = true、windowstyle = = none 等等。This means windows in which AllowTransparency == true, window.windowstyle == none, and so on.

  • 在全視窗轉譯期間不會發生滾動加速。Scrolling acceleration does not occur during full-window rendering.

  • 當視窗跨越兩個監視器時,滾動加速無法運作。Scrolling acceleration does not work when the window straddles two monitors.

  • 在滾動的元素的父代鏈中,如果有中繼呈現目標,滾動加速就無法運作。Scrolling acceleration does not work in the presence of intermediate render targets in the parent chain of the scrolled element. 下列清單顯示其中一些中繼呈現目標。The following list shows some of these intermediate render targets.

    • 剪輯Clips

    • 效果Effects

    • DrawingBrushesDrawingBrushes

    • VisualBrushesVisualBrushes

    • OpacityMasksOpacityMasks

    • 不透明度Opacity

  • 每個畫面格只能有一個加速捲軸。Only one accelerated scroll can happen per frame. 可以有多個加速捲軸區域,但只有其中一個可以在框架期間執行加速的滾動。There can be multiple accelerated scroll areas, but only one of them can perform an accelerated scroll during a frame. 要滾動的區域是不確定的。Which area is scrolled is indeterminate.

  • 滾動加速支援捲動區域上方的內容 (以迭置順序) ,而不是以其餘內容來滾動。Scrolling acceleration supports content above the scrolling region (in z-order) that is not scrolled with the rest of the content. 系統會計算所有必要的已變更區域,並完成加速的滾動,但它會透過網路傳送數個額外的點陣圖,以將意外滾動的部分移回螢幕上的正確位置。The system calculates all necessary dirty regions and completes the accelerated scroll, but it sends several additional bitmaps over the wire to move the unintentionally scrolled portion back to its correct position on screen.

適用於