2 回答

TA貢獻(xiàn)1847條經(jīng)驗(yàn) 獲得超7個(gè)贊
我能夠使用類似于此處描述的光標(biāo)創(chuàng)建方法(在mm8的答案中的鏈接中沒(méi)有步幅問(wèn)題)。
此外,使用 PackIconControl 的代碼如下所示。
PackIconControl pic = new PackIconControl() { Kind = PackIconMaterialKind.CursorDefaultOutline, Width = 16, Height = 16};
pic.Style = Application.Current.FindResource(typeof(PackIconControl)) as Style;
pic.Foreground = Brushes.White;
m_MyCursor = CursorUtil.ConvertToCursor(pic, new Point(4,1));
一些評(píng)論:
我必須顯式指定樣式,因?yàn)槲疑形磳⒖丶砑拥娇梢暬瘶?shù)中。我的應(yīng)用的資源字典中包含 mahapps 樣式。
CursorUtil.ConvertToCursor是上述鏈接中提到的方法。
Point(4,1) 將光標(biāo)的熱點(diǎn)放在大約 PackIconMaterialKind.CursorDefaultOutline 箭頭的尖端。其他圖標(biāo)將具有不同的熱點(diǎn),這些熱點(diǎn)適用于其特定形狀。
- 2 回答
- 0 關(guān)注
- 123 瀏覽
添加回答
舉報(bào)