Subversion Repositories Kolibri OS

Rev

Rev 7266 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
7260 leency 1
dword screen_copy;
2
 
3
void ScreenCopy_activate() {
4
	SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE);
5
	screen_copy = malloc(image.columns * image.rows * 3 );
6
}
7
 
8
void ScreenCopy_onMouseEvent(int mouseX, int mouseY, int lkm, int pkm) {
9
	dword i;
10
	CopyScreen(screen_copy, mouse.x + Form.left + 5, mouse.y + Form.top + skin_height, image.columns, image.rows);
11
	for (i = 0; i < image.columns*image.rows; i++;)
12
	{
13
		image.mas[i] = ESDWORD[i*3+screen_copy] & 0xFFFFFF;
14
	}
15
	DrawCanvas();
16
 
17
	if (mouse.down) {
18
		screen_copy = free(screen_copy);
19
		SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER);
20
		actionsHistory.saveCurrentState();
21
		setCurrentTool(previousTool);
22
	}
23
}