画图操作中,如何在点击滚动条时不让图闪动呢
private void drawImage(Graphics g, int x, int y)
{
g.SetClip(ScrollingImageRectangle);
Rectangle drawRect = new Rectangle(new Point(x, y), ScrollingImageRectangle.Size);
g.DrawImage(this.scrollingImage, ScrollingImageRectangle, drawRect, GraphicsUnit.Pixel);
}
我在每次点击了滚动条后就去执行上面的函数..
但是这样它会闪动..
------解决方案--------------------1)DoubleBuffer
2)用Invalidate(Region)
3)用DrawImageUnscaledAnd....
------解决方案--------------------1)DoubleBuffer