Thanks for the reply. I want to split up images horizontally in to two pieces. How can i set the co ordinates.
-Thanks with regards,
Rodricks
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35258
7
posted
0
If you have an image with the corners (0,0), (w,0), (w,h) and (0,h), what would be the coordinates for the two subimages?
I'll give a clue:
1st image: (0,0), (xxx,0), (xxx,h) and (0,h)
2nd image: (xxx+1,0), (w,0), (w,h) and (xxx+1,h)
What value would "xxx" have? You need to consider two cases: "w" is even, and "w" is odd.
Rodricks george
Ranch Hand
Joined: Sep 10, 2006
Posts: 97
posted
0
Dear Sir,
Here the code i implemented for splitting images into two horizontally
If i want to split horizontally and vertically by passing the co ordinates at any position, how can i achieve this.
getSubimage(x,y,w,h)
thanks with regards, Rodricks.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35258
7
posted
0
The code you posted has a bug. Compare the height of the two images with the heigth of the original one. Then have a look at the pseudo-code I posted before.
If i want to split horizontally and vertically by passing the co ordinates at any position, how can i achieve this.
Not sure I understand what you're asking. If you know at which position you want to split the image, you can use appropriate parameters in the call to getSubimage.