carbon: fix for mask/gray color images creation

git-svn-id: trunk@25956 -
This commit is contained in:
dmitry 2010-06-06 19:33:08 +00:00
parent 0f2d6c94a9
commit 77d51a79d2

View File

@ -1928,6 +1928,10 @@ begin
FType := AType;
FAlignment := AAlignment;
//todo: FDepth should not be Zero. Need to find out what's causing it.
if (FType in [cbtMono, cbtGray]) and (FDepth=0) then
FDepth:=FBitsPerPixel;
FBytesPerRow := ((AWidth * ABitsPerPixel) + 7) shr 3;
M := FBytesPerRow and ALIGNBITS[AAlignment];
if M <> 0 then Inc(FBytesPerRow, ALIGNBITS[AAlignment] + 1 - M);