mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 08:30:58 +02:00
MG: fixed calculation of bitmap size
git-svn-id: trunk@1884 -
This commit is contained in:
parent
6887088c65
commit
54e07251dc
@ -1098,8 +1098,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
If BitSize <= 0 then
|
If BitSize <= 0 then
|
||||||
BitSize := SizeOf(Byte)*(Longint(biSizeImage) div biHeight)*(NumScans + StartScan);
|
BitSize := SizeOf(Byte)*(Longint(biSizeImage) div biHeight)
|
||||||
If MemSize(Bits) <> (BitSize + 5) then begin
|
*(NumScans + StartScan);
|
||||||
|
If MemSize(Bits) <> BitSize then begin
|
||||||
writeln('WARNING: [TgtkObject.InternalGetDIBits] not enough memory allocated for Bits!');
|
writeln('WARNING: [TgtkObject.InternalGetDIBits] not enough memory allocated for Bits!');
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -3223,26 +3224,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Andrew, plz check this:
|
biSizeImage := (((biBitCount*biWidth+31) shr 5) shl 2)*biHeight;
|
||||||
if (biBitCount <> 24) and
|
|
||||||
((biWidth mod (biBitCount div 8)) <> 0)
|
|
||||||
then
|
|
||||||
biSizeImage := biWidth + (biBitCount div 8)
|
|
||||||
else
|
|
||||||
biSizeImage := biWidth;
|
|
||||||
{if (biBitCount <> 24) and
|
|
||||||
((biWidth mod (8 div biBitCount)) <> 0)
|
|
||||||
then
|
|
||||||
biSizeImage := biWidth + (8 div biBitCount)
|
|
||||||
else
|
|
||||||
biSizeImage := biWidth;}
|
|
||||||
|
|
||||||
if ((biWidth*biBitCount div 8) mod 4) = 0 then
|
|
||||||
biSizeImage := biSizeImage*biBitCount div 8
|
|
||||||
else
|
|
||||||
biSizeImage := (biSizeImage*biBitCount div 8) + 4;
|
|
||||||
|
|
||||||
biSizeImage := biSizeImage*biHeight;
|
|
||||||
|
|
||||||
//I have no idea what I am doing here, but whatever...
|
//I have no idea what I am doing here, but whatever...
|
||||||
If GetSystemMetrics(SM_CXSCREEN) >= biWidth then
|
If GetSystemMetrics(SM_CXSCREEN) >= biWidth then
|
||||||
@ -6729,6 +6711,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.128 2002/09/10 15:23:22 lazarus
|
||||||
|
MG: fixed calculation of bitmap size
|
||||||
|
|
||||||
Revision 1.127 2002/09/10 06:49:22 lazarus
|
Revision 1.127 2002/09/10 06:49:22 lazarus
|
||||||
MG: scrollingwincontrol from Andrew
|
MG: scrollingwincontrol from Andrew
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user