【发布时间】:2011-03-27 15:23:10
【问题描述】:
我正在尝试使用 gdi 创建球动画,但我无法让它工作。 我用这个创建了一个球
Graphics graphics(hdc);
Pen pen(Color(255, 0, 0, 255)); graphics.DrawEllipse(&pen, sf, 0, 10, 10); 我有 while 循环,它循环并将 1 添加到 sf 值,基本上就像这个 sf++; 比我尝试重新粉刷窗户(它不起作用),所以最终会出现不止一个圆圈;/ 这是循环(循环是 int WM_PAINT)
while(sd==1)//sd equals 1
{
sf++;
onPaint(hdc);
InvalidateRect (hWnd, NULL, TRUE);// this should repaint the window but it doesn't
UpdateWindow(hWnd);
}
提前致谢 拉米
【问题讨论】:
标签: c++ visual-c++ winapi gdi repaint