Here's a short example:
Code: Select all
Image *pImage = new Image("d:\\temp\\Tile.png");
Pixels *pCache = new Pixels(*pImage);
PixelPacket *pPixels = pCache->get(0, 0, TILE_SIZE, TILE_SIZE);
pImage->modifyImage();
PixelPacket *pDst = pPixels;
for(int i=0; i<TILE_SIZE * TILE_SIZE; i++) {
pDst->red = QuantumRange;
pDst->green = 0;
pDst->blue = 0;
pDst++;
}
pCache->sync();
pImage->write("d:\\temp\\Test1.png");
SAFE_DELETE(pCache);
SAFE_DELETE(pImage);
I need Test1.png to always have the exact same format as Tile.png.
I've tried adding pImage->type(TrueColorType) and pImage->depth(16), but they have no apparent effect. The library is compiled for 16-bit channels, x64, Visual Studio 2012.
Any thoughts or comments welcome.