MG: bugfix for readstream

git-svn-id: trunk@220 -
This commit is contained in:
lazarus 2001-03-12 09:40:44 +00:00
parent 1c8feee052
commit 106110f999

View File

@ -118,7 +118,7 @@ end;
procedure TBitmap.ReadStream(Stream: TStream; Size: Longint); procedure TBitmap.ReadStream(Stream: TStream; Size: Longint);
type type
BITMAP = record BITMAP = packed record
bmType : Longint; bmType : Longint;
bmWidth : Longint; bmWidth : Longint;
bmHeight : Longint; bmHeight : Longint;
@ -129,7 +129,7 @@ type
end; end;
PBITMAP = ^BITMAP; PBITMAP = ^BITMAP;
BITMAPINFOHEADER = record BITMAPINFOHEADER = packed record
biSize : DWORD; biSize : DWORD;
biWidth : Longint; biWidth : Longint;
biHeight : Longint; biHeight : Longint;
@ -143,14 +143,14 @@ type
biClrImportant : DWORD; biClrImportant : DWORD;
end; end;
RGBQUAD = record RGBQUAD = packed record
rgbBlue : BYTE; rgbBlue : BYTE;
rgbGreen : BYTE; rgbGreen : BYTE;
rgbRed : BYTE; rgbRed : BYTE;
rgbReserved : BYTE; // rgbReserved : BYTE;
end; end;
BITMAPINFO = record BITMAPINFO = packed record
bmiHeader : BITMAPINFOHEADER; bmiHeader : BITMAPINFOHEADER;
bmiColors : array[0..0] of RGBQUAD; bmiColors : array[0..0] of RGBQUAD;
end; end;
@ -211,7 +211,7 @@ begin
GetMem(Bits,ImgSize); GetMem(Bits,ImgSize);
try try
ReadSize:=Stream.Read(Bits^,ImgSize); ReadSize:=Stream.Read(Bits^,ImgSize);
if ReadSize<>InfoSize then if ReadSize<>ImgSize then
raise EInOutError.Create('Invalid windows bitmap (bits)'); raise EInOutError.Create('Invalid windows bitmap (bits)');
// ToDo: create a bitmap handle // ToDo: create a bitmap handle
@ -311,6 +311,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.4 2001/03/12 09:40:44 lazarus
MG: bugfix for readstream
Revision 1.3 2001/03/05 14:20:04 lazarus Revision 1.3 2001/03/05 14:20:04 lazarus
added streaming to tgraphic, added tpicture added streaming to tgraphic, added tpicture