Subversion Repositories Kolibri OS

Rev

Rev 7260 | Rev 7271 | Go to most recent revision | Details | Compare with Previous | 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;
7266 leency 10
	CopyScreen(screen_copy,
11
		mouse.x + Form.left + 5 - calc(image.columns/2),
12
		mouse.y + Form.top + skin_height - calc(image.rows/2),
13
		image.columns, image.rows);
7260 leency 14
	for (i = 0; i < image.columns*image.rows; i++;)
15
	{
16
		image.mas[i] = ESDWORD[i*3+screen_copy] & 0xFFFFFF;
17
	}
18
	DrawCanvas();
19
 
20
	if (mouse.down) {
21
		screen_copy = free(screen_copy);
22
		SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER);
23
		actionsHistory.saveCurrentState();
24
		setCurrentTool(previousTool);
7266 leency 25
		if (!CheckActiveProcess(Form.ID)) ActivateWindow(GetProcessSlot(Form.ID));
7260 leency 26
	}
27
}