mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 13:17:18 +02:00
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:
parent
abc6f21f08
commit
e005e58a07
@ -1312,8 +1312,12 @@ begin
|
|||||||
FHandle := QImage_create(width, height, format);
|
FHandle := QImage_create(width, height, format);
|
||||||
QImage_fill(FHandle, 0);
|
QImage_fill(FHandle, 0);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
begin
|
||||||
FHandle := QImage_create(FData, width, height, format);
|
FHandle := QImage_create(FData, width, height, format);
|
||||||
|
if format=QImageFormat_Mono then
|
||||||
|
QImage_setNumColors(FHandle, 2);
|
||||||
|
end;
|
||||||
QtGDIObjects.AddGDIObject(Self);
|
QtGDIObjects.AddGDIObject(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1325,8 +1329,12 @@ begin
|
|||||||
|
|
||||||
if FData = nil then
|
if FData = nil then
|
||||||
FHandle := QImage_create(width, height, format)
|
FHandle := QImage_create(width, height, format)
|
||||||
else
|
else
|
||||||
|
begin
|
||||||
FHandle := QImage_create(FData, width, height, bytesPerLine, format);
|
FHandle := QImage_create(FData, width, height, bytesPerLine, format);
|
||||||
|
if format=QImageFormat_Mono then
|
||||||
|
QImage_setNumColors(FHandle, 2);
|
||||||
|
end;
|
||||||
QtGDIObjects.AddGDIObject(Self);
|
QtGDIObjects.AddGDIObject(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user