どなたかinvalidaterectの使い方を教えてください。
普通にinvalidate()するよりも軽くなるんでしょうか?
[DllImport("user32.dll")]
private static extern IntPtr GetDC(IntPtr hwnd);
[DllImport("user32.dll")]
private static extern bool InvalidateRect(
IntPtr hWnd,
ref Rectangle r,
bool bErase
);
private void button2_Click(object sender, EventArgs e)
{
Graphics gra = pictureBox1.CreateGraphics();
IntPtr hwnd = gra.GetHdc();
Rectangle rect = new Rectangle(100,100,100,100);
InvalidateRect(hwnd, rect, false);
}
調べたんですがこの程度しか分かりませんでした。あってるのかも分からないです