Subversion Repositories Kolibri OS

Rev

Rev 7259 | Rev 7275 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7259 Rev 7265
Line 60... Line 60...
60
	void draw_line();
60
	void draw_line();
61
	void fill();
61
	void fill();
62
	void set_image();
62
	void set_image();
63
	dword get_pixel();
63
	dword get_pixel();
64
	dword get_image();
64
	dword get_image();
-
 
65
	dword get_image_with_replaced_color();
65
	void move();
66
	void move();
66
};
67
};
Line 67... Line 68...
67
 
68
 
68
void _image::create(int _rows, _columns)
69
void _image::create(int _rows, _columns)
Line 185... Line 186...
185
			ESBYTE[i] = rgb.b;
186
			ESBYTE[i] = rgb.b;
186
			ESBYTE[i+1] = rgb.g;
187
			ESBYTE[i+1] = rgb.g;
187
			ESBYTE[i+2] = rgb.r;
188
			ESBYTE[i+2] = rgb.r;
188
			i += 3;
189
			i += 3;
189
		}
190
		}
-
 
191
	return img;
-
 
192
}
-
 
193
 
-
 
194
dword _image::get_image_with_replaced_color(dword _col_from, _col_to)
-
 
195
{
-
 
196
	int r=0, c=0;
-
 
197
	dword i;
-
 
198
	dword cur_pixel;
-
 
199
 
-
 
200
	free(img);
-
 
201
	i = img = malloc(rows*columns*3);
-
 
202
 
-
 
203
	for (r = 0; r < rows; r++)
-
 
204
		for (c = 0; c < columns; c++)
-
 
205
		{
-
 
206
			cur_pixel = get_pixel(r,c);
-
 
207
			if (cur_pixel == _col_from) cur_pixel = _col_to;
-
 
208
			rgb.DwordToRgb(cur_pixel);
-
 
209
			ESBYTE[i] = rgb.b;
-
 
210
			ESBYTE[i+1] = rgb.g;
-
 
211
			ESBYTE[i+2] = rgb.r;
-
 
212
			i += 3;
-
 
213
		}
190
	return img;
214
	return img;
191
}
215
}
Line 192... Line 216...
192
 
216
 
193
enum {
217
enum {