views:

150

answers:

0

In MacOS 10.5 (Leopard) and 10.4 (Tiger) the following code was working fine:

NSImage *pBitmapImage = [[NSImage alloc] initWithSize:[pThumbBmp size]];
[pBitmapImage addRepresentation:pThumbBmp];
NSSize pThumbSize =[pBitmapImage size];

if(pThumbBmp)
{
    [pThumbBmp release];
    pThumbBmp = NULL;
}
[pBitmapImage lockFocus];
[fillColor set];
NSRectFill(rcResizedDestRectSize);
[pCanvasBmp drawInRect:rcResizedDestRectSize];
pThumbBmp = [[NSBitmapImageRep alloc] initWithFocusedViewRect:NSMakeRect(0,0,pThumbSize.width,pThumbSize.height)];
[pBitmapImage unlockFocus];

... but in Snow Leopard it is not working. The reason is given here but I am not getting a solution for this problem for drawing the one NSBitmapImageRep object from another NSBitmapImageRep object.