C# 局部刷新



this

.Invalidate();

//

刷新控件

this

.Invalidate(

new

Rectangle

(0,

0,

100,

100));

//

刷新指定区域

thi

s.Invalidate(

Region

rg);

//

刷新指定路径区域

eg:

private

void

RefreshLine()

{

ps[0]

=

new

Point

(3,

1);

ps[3]

=

new

Point

(1,

3);

ps[1]

=

new

Point

(_mousep.X

+

5,

_mousep.Y

-

5);

ps[2]

=

new

Point

(_mousep.X,

_mousep.Y

+

5);

gp.Reset();

//GraphicsPath

gp.AddLines(ps);

//gp.AddPolygon(ps);

Region

rg

=

new

Region

(gp);

this

.Invalidate(rg);

rg.Dispose();

}

this

.Invalidate();

//

刷新控件

this

.Invalidate(

new

Rectangle

(0,

0,

100,

100));

//

刷新指定区域

thi

s.Invalidate(

Region

rg);

//

刷新指定路径区域

eg:

private

void

RefreshLine()

{

ps[0]

=

new

Point

(3,

1);

ps[3]

=

new

Point

(1,

3);

ps[1]

=

new

Point

(_mousep.X

+

5,

_mousep.Y

-

5);

ps[2]

=

new

Point

(_mousep.X,

_mousep.Y

+

5);

gp.Reset();

//GraphicsPath

gp.AddLines(ps);

//gp.AddPolygon(ps);

Region

rg

=

new

Region

(gp);

this

.Invalidate(rg);

rg.Dispose();

}

猜你喜欢

转载自blog.csdn.net/coolfishbone_joey/article/details/79240231