Created
July 24, 2010 05:39
-
-
Save onlyshk/488440 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GdkPixbuf* sub_pixbuf = NULL; | |
int i = 0; | |
int j = 0; | |
int k = 0; | |
int n = 0; | |
guint width = 0; | |
guint height = 0; | |
guint width1 = 0; | |
guint height1 = 0; | |
guint x = 210; | |
guint y = 297; | |
width = gdk_pixbuf_get_width(pixbuf); | |
height = gdk_pixbuf_get_height(pixbuf); | |
width1 = gdk_pixbuf_get_width(pixbuf); | |
height1 = gdk_pixbuf_get_height(pixbuf); | |
/* | |
guint count_w = 0; | |
while (width >= 208) | |
{ | |
width -= 208; | |
++count_w; | |
} | |
if (width != 0) | |
++count_w; | |
j = 0; | |
i = 0; | |
int temp = 0; | |
int count_h = 0; | |
while (height >= 295) | |
{ | |
height -= 295; | |
++count_h; | |
} | |
if (height != 0) | |
count_h++; | |
int z = 0; | |
for (temp; temp < count_h; temp++) | |
{ | |
for (i; i < count_w; i++) | |
{ | |
if (i == count_w - 1) | |
{ | |
sub_pixbuf = gdk_pixbuf_new_subpixbuf(pixbuf, j, z, width - 1 , 295); | |
list = g_list_append (list, sub_pixbuf); | |
} | |
else | |
{ | |
sub_pixbuf = gdk_pixbuf_new_subpixbuf(pixbuf, j, z, 208, 295); | |
list = g_list_append (list, sub_pixbuf); | |
j += 208; | |
} | |
} | |
if ((height1 - z) < 295) | |
{ | |
z = height; | |
} | |
else | |
{ | |
z += height; | |
} | |
i = 0; | |
j = 0; | |
} | |
//} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment