| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Hi, Larry. I believe that you'll want to create a new NSImage that's the precise size of all of the assembled pieces. Then you'll lock focus on it, use drawing operations for the other images, and then unlock focus. This was composed in Mail.app, and assumes the existence of some constants like tileHeight and tileWidth. Someone else is likely to notice an error or two--you might need to specify a rectangle (there are a few variations of compositeToPoint:) and drawAtPoint: might also be an option in your case, depending on the situation. ---start code --- NSSize combinedTileSize = ....; // Figure out your big image size NSImage *theBigPicture = [[NSImage alloc] initWithSize:combinedTileSize]; [theBigPicture lockFocus]; int x, y; /* come up with an algorithm to place the tiles here; for example: */ /*for (x = 0; x < theBigPictureTotalColumns; ++x) { for (y = 0; y < theBigPictureTotalRows; ++y) { [theTileForThisPosition compositeToPoint:NSMakePoint(x * tileWidth, y * tileHeight) operation:NSCompositeCopy]; } }*/ [theBigPicture unlockFocus]; /* do stuff with your picture */ [theBigPicture release]; // don't forget that! ----end code----- Best wishes, Andrew Merenbach On May 31, 2005, at 3:58 PM, Larry Gerndt wrote: My application receives an image from a server which sends the image as a series of tiles-- that is, it grids the image and sends each section of the grid as a separate message. I know how to convert each received tile into an NSImage, but I don't know how to assemble these individual NSImages into one whole NSImage. Can anyone give me some advice? Thanks in advance. |
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden This email sent to email@hidden
| References: | |
| >Composing a single whole NSImage from pieces (tiles) (From: Larry Gerndt <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.