iphone - Get the identity of the image loaded at the centre of the screen currently? -


I contentsize equal size is a UIScrollView with loaded in the 1280 * 1280 25 images. When I scroll and meet one end, I want to know the identity of the image which is currently present in the screen center. I used the code below to load the images in ScrollView. How can I understand this?

  (i = 0; i & LT; 5; i ++) {if (j == 5) {tx = tx + 1; X = X + 256; Ty = ty + 5; Y = y-1280; The} (j = 0; j & LT; 5; J ++) {imageView = [[UIImageView alloc] initWithImage: [UIImage imageWithData: [NSData dataWithContentsOfURL: [NSURL URLWithString: [NSString stringWithFormat: @ "http: // stage.discoveritalia. Ty] it / tiles /% d /% d /% d.png ", zoom, tx,]]]]; Frame = [image view frame]; Frame.origin.x = x; Frame.origin.y = y; [ImageView set frame: frame]; [MyScrollView addSubview: imageView]; Ty = ty-1; Y = y + 256; [ImageArray insertObject: imageView atIndex: I * 5 + j]; [See image release]; }}  

I can get the URL back, this will solve my problem immediately. Is there any way to do this?

  1. Calculate Sijeepiint in the center of the screen (at orientation depends)
  2. x and y values ​​ 1280/5 tile ij < To determine / code> index, add ((1280/5) / 2) that the center will overlap, without UIScrollView offset
now

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -