From 106110f999c3d423f834af81084ab29ff1729355 Mon Sep 17 00:00:00 2001 From: lazarus Date: Mon, 12 Mar 2001 09:40:44 +0000 Subject: [PATCH] MG: bugfix for readstream git-svn-id: trunk@220 - --- lcl/include/bitmap.inc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lcl/include/bitmap.inc b/lcl/include/bitmap.inc index ac97e9595b..6e035a36bf 100644 --- a/lcl/include/bitmap.inc +++ b/lcl/include/bitmap.inc @@ -118,7 +118,7 @@ end; procedure TBitmap.ReadStream(Stream: TStream; Size: Longint); type - BITMAP = record + BITMAP = packed record bmType : Longint; bmWidth : Longint; bmHeight : Longint; @@ -129,7 +129,7 @@ type end; PBITMAP = ^BITMAP; - BITMAPINFOHEADER = record + BITMAPINFOHEADER = packed record biSize : DWORD; biWidth : Longint; biHeight : Longint; @@ -143,14 +143,14 @@ type biClrImportant : DWORD; end; - RGBQUAD = record + RGBQUAD = packed record rgbBlue : BYTE; rgbGreen : BYTE; rgbRed : BYTE; - rgbReserved : BYTE; + // rgbReserved : BYTE; end; - BITMAPINFO = record + BITMAPINFO = packed record bmiHeader : BITMAPINFOHEADER; bmiColors : array[0..0] of RGBQUAD; end; @@ -211,7 +211,7 @@ begin GetMem(Bits,ImgSize); try ReadSize:=Stream.Read(Bits^,ImgSize); - if ReadSize<>InfoSize then + if ReadSize<>ImgSize then raise EInOutError.Create('Invalid windows bitmap (bits)'); // ToDo: create a bitmap handle @@ -311,6 +311,9 @@ end; { ============================================================================= $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 added streaming to tgraphic, added tpicture