本文整理汇总了C#中ManagedWinapi.Windows.SystemWindow.Refresh方法的典型用法代码示例。如果您正苦于以下问题:C# SystemWindow.Refresh方法的具体用法?C# SystemWindow.Refresh怎么用?C# SystemWindow.Refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ManagedWinapi.Windows.SystemWindow
的用法示例。
在下文中一共展示了SystemWindow.Refresh方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AnimateCursorOnWindow
private static void AnimateCursorOnWindow(SystemWindow window, Point point)
{
new Thread(new ThreadStart(delegate
{
// Create a device context that cover the whole display (all monitors)
IntPtr hDC = CreateDC("DISPLAY", "", "", IntPtr.Zero);
// Get a graphics
using (Graphics g = Graphics.FromHdc(hDC))
{
const int radius = 30;
g.SmoothingMode = SmoothingMode.AntiAlias;
g.CompositingMode = CompositingMode.SourceOver;
g.Clip = new Region(new Rectangle(point.X - (radius + 10) / 2, point.Y - (radius + 10) / 2,
radius + 10, radius + 10));
// Draw a growing circle upon the cursor
Brush trans = Brushes.Transparent;
Pen penGr = new Pen(Color.LightGray, 1);
Pen penDG = new Pen(Color.DimGray, 1);
Pen penLG = new Pen(Color.LightGray, 1);
for (int j = 0; j < 2; j++)
{
for (int i = 0; i < radius; i+=2)
{
Rectangle ellRect = new Rectangle(point.X - i / 2, point.Y - i / 2, i, i);
g.FillEllipse(trans, ellRect);
ellRect.Inflate(1, 1);
g.DrawEllipse(penGr, ellRect);
ellRect.Inflate(1, 1);
g.DrawEllipse(penDG, ellRect);
ellRect.Inflate(1, 1);
g.DrawEllipse(penLG, ellRect);
//g.Clear(Color.Transparent);
window.Refresh();
}
window.Refresh();
}
}
// Delete the device context
DeleteDC(hDC);
}
)).Start();
}