Re: Storing images in subfolder of apps resource?
Re: Storing images in subfolder of apps resource?
- Subject: Re: Storing images in subfolder of apps resource?
- From: Ryan Stevens <email@hidden>
- Date: Mon, 14 Feb 2005 07:24:46 -0800
On Feb 13, 2005, at 4:50 PM, Scott Andrew wrote:
I have a bunch of images that I want to organize in app as subfolders.. Can
I do this with XCODE? I would like to do the following:
Application\Resources\Asprite
Frame1.png
Frame2.png
Frame3.png
Aplication\Resources\Bsprite
Frame1.png
Frame2.png
You could reduce that to Asprite.tiff (which contains Frame1, 2, 3...) and Bsprite.tiff (1, 2). Then you wouldn't need subfolders to separate them....
{
[
frame1 addRepresentationsFromImage:frame2];
[frame1 addRepresentationsFromImage:frame3];
[[frame1 TIFFRepresentation] writeToFile:@"/..../Asprite.tiff" atomically:NO];
NSLog(@"Asprite array: %@", [frame1 imagesFromRepresentations]);
}
@implementation NSImage (Whatever)
- (NSArray *)imagesFromRepresentations
{
NSMutableArray *contents = [NSMutableArray array];
NSImage *tmp;
NSArray *reps = [self representations];
int count = [reps count];
int i=0;
for (;i<count;i++) {
id rep = [reps objectAtIndex:i];
tmp = [[NSImage alloc] initWithSize:[rep size]];
[tmp addRepresentation:rep];
[tmp setFlipped:YES];
[contents addObject:tmp];
[tmp release];
}
return contents;
}
- (void)addRepsFromImage:(NSImage *)image
{
[self addRepresentations:[image representations]];
}
@end _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden