BeginBatchDraw

This function is used to begin batch drawing mode. After execution, any drawing operations will be temporarily not output to the graphics windows until call function flushBatchDraw or EndBatchDraw.

void BeginBatchDraw();

Parameters

None

Return Value

None

Examples

The following code implements a circle that moves from left to right with a more noticeable flicker.
Cancel the three comments in the main function to implement the batch drawing feature, which eliminates flickering.

#include <graphics.h>

int main()
{
	initgraph(640,480);
	// BeginBatchDraw();

	setlinecolor(WHITE);
	setfillcolor(RED);

	for(int i=50; i<600; i++)
	{
		cleardevice();
		circle(i, 100, 40);
		floodfill(i, 100, WHITE);
		// FlushBatchDraw();
		Sleep(10);
	}

	// EndBatchDraw();
	closegraph();
}
(贡献者:Krissi  编辑