Heh, this is one of the trickier APIs to work with. Use the AIArtSetSuite functions to build up an art set of what you want to rasterize. There are some nice helper functions in there to rapidly compile all the art in the document layer-by-layer if that's what you're trying to do. Setup the AIRasterizeSettings object type - colour mode of the output raster (e.g. greyscale, ARGB, RGB, CMYK, etc.) resolution - this is actually asking for the DPI. 72dpi is 'normal' anti-aliasing - there are few options, you'll have to pick the appropriate one from the #defines they provide options - again, check their list. There are some interesting ones in there, but kRasterizeOptionsNone is a good starting point. colour conversion options - just stick with the default unless you have reason to tinker spot colour preservation - again, unless you need to do something specific, leave this as the default You need to provide the bounds to be rasterized; I believe this is so that you could, say, provide an artset of the whole document, but then only rasterize a specific region. When in doubt, just get the bounds of the artset and use that. The AIRasterizeSuite has a function, ComputeBounds that takes an AIArtSetHandle -- use it! The next three arguments are the same as when you create any art: paintOrder - where, relative to the next argument (prep) do you want to put the newly created art? prep - art to use in conjunction with paintOrder - note that some paintOrder options don't require a prep parameter; 0 will suffice in those cases. raster - address of the handle in which to store the newly create art. Rasterize is going to create an image art object on the canvas where you specified using the first two parameters (paintOrder & prep). This will contain the results of the rasterization operation. The last parameter is expecting a function that matches the prototype of AIRasterizeProgressProc (defined in AIRasterize.h) During the rasterization process, it will periodically call this method so if you want to, you can show a progress dialog. You can just define a function that does nothing if you want. If all you want to do is create an image art object on the canvas, then you're done. If you want to take that image and write to a file, you've got a lot more work to do. For that, you'll have to look at how you pull the image data out of an AIRasterHandle and then convert it into PNG or JPEG or whatever you're trying to write to. It's a pain. Unfortunately, I didn't write that part of our code, so I can't help there. You can test the first part easily enough though. If your rasterization works, you'll have an image object on the canvas and you just need to look at it to tell if it did what you want If you need to put that data somwhere else, all I can do is point you at AIRaster.h, specifically at the calls involving AISlice & AITile. Good luck!
... View more