Subversion Repositories Kolibri OS

Rev

Rev 5409 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5408 leency 1
struct libimg_image {
2
	dword image, w, h;
3
};
4
 
5409 leency 5
:void Libimg_LoadImage(dword struct_pointer, file_path)
5408 leency 6
{
5409 leency 7
	dword image_pointer;
5408 leency 8
	image_pointer = load_image(file_path);
5421 leency 9
	if (!image_pointer) notify("'Error: Image not loaded' -E");
5408 leency 10
	ESDWORD[struct_pointer] = image_pointer;
11
	ESDWORD[struct_pointer+4] = DSWORD[image_pointer+4];
12
	ESDWORD[struct_pointer+8] = DSWORD[image_pointer+8];
5409 leency 13
}
14
 
15
:void Libimg_FillTransparent(dword struct_pointer, w, h, new_transparent_color)
16
{
17
	dword i, max_i, image_data;
18
	image_data = ESDWORD[struct_pointer + 24];
19
	max_i =  w * h * 4 + image_data;
20
	for (i = image_data; i < max_i; i += 4)	if (DSDWORD[i]==0) DSDWORD[i] = new_transparent_color;
5408 leency 21
}