LCL, QT, set number of colors to 2 for mono images, this avoids crash if QT is compiled with debug info because then assertions are enabled

git-svn-id: trunk@40671 -
This commit is contained in:
jesus 2013-03-29 21:04:33 +00:00
parent abc6f21f08
commit e005e58a07

View File

@ -1312,8 +1312,12 @@ begin
FHandle := QImage_create(width, height, format);
QImage_fill(FHandle, 0);
end
else
else
begin
FHandle := QImage_create(FData, width, height, format);
if format=QImageFormat_Mono then
QImage_setNumColors(FHandle, 2);
end;
QtGDIObjects.AddGDIObject(Self);
end;
@ -1325,8 +1329,12 @@ begin
if FData = nil then
FHandle := QImage_create(width, height, format)
else
else
begin
FHandle := QImage_create(FData, width, height, bytesPerLine, format);
if format=QImageFormat_Mono then
QImage_setNumColors(FHandle, 2);
end;
QtGDIObjects.AddGDIObject(Self);
end;