0

I can generate a BitmapSource from a button fine, however it always is just the image of the normal state of the button.

I want to be able to generate a BitmapSource of the over state of a button.

I tried calling VisualStateManager.GoToState((FrameworkElement)target, "MouseOver", true); before calling my code to generate the BitmapSource. It correctly changes the button to the overstate on the GUI, but the BitmapSource is still that of the button in the normal state.

4

1 回答 1

0

我解决了这个问题。VisualStateManager.GoToState((FrameworkElement)target, "MouseOver", true);刚开始转换到指定的状态。在尝试保存位图之前,我需要将控制权交还给 UI 线程并等待状态实际更改。

于 2010-01-13T23:38:53.420 回答