I am working on a pixel app for iPhone. Since the pictures taken with the iPhone 4 camera are too large, and therefore the application is very slow when updating the pixel image, I try to create image tiles first and just refresh the tiles, not the hole image.
When creating tiles, it works for camera cameras made in landscape mode (2592 x 1936 pxl) and with low-resolution images, but not with images made in portrait mode (1936 x 2592 pxl).
The code for cutting tiles from the original image is as follows:
for (i = 0; i < NrOfTilesPerHeight; i++) { for (j = 0; j < NrOfTilesPerWidth; j++) { CGRect imageRect = CGRectMake(j*TILE_WIDTH, i*TILE_HEIGHT, TILE_WIDTH, TILE_HEIGHT); CGImageRef image = CGImageCreateWithImageInRect(aux.CGImage, imageRect); UIImage *img = [UIImage imageWithCGImage:image]; UIImageView *imgView = [[UIImageView alloc] initWithImage:img]; } }
The problem is that the image created using these plates rotates 90 degrees counterclockwise.
Thank you so much Andrey
Andrei Neacsu
source share