2

OpenGL のテクスチャとして使用するには、大きな画像 (高さ約 10000px) をいくつかの小さな画像に分割する必要があります。かなり時間がかかっています。

NSArray *images = [NSArray alloc] initWith 
for (int i = 0; i<numberOfImages; i++){

    int t = i*origHeight;
    CGRect fromRect = CGRectMake(0, t, origWidth, origHeight); // or whatever rectangle

    CGImageRef drawImage = CGImageCreateWithImageInRect(sourceImage.CGImage, fromRect);

    UIImage *newImage = [UIImage imageWithData:UIImageJPEGRepresentation([UIImage imageWithCGImage:drawImage],1.0)];

    [images addObject:newImage];

    CGImageRelease(drawImage);
}
4

1 に答える 1

1

たとえば、 brewで取得できるImageMagickconvertでコマンドを使用する前に、それらを事前に分割できます

http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=15771

于 2012-09-25T22:43:58.107 に答える